CDO/Hibernate Store/Model Relational Mapping
The CDO Hibernate Store can use Teneo for the Model Relational mapping. Teneo generates a mapping for Hibernate on the basis of the ecore model and optional JPA annotations. JPA annotations can be specified directly in the model or in a separate xml.
Teneo supports all JPA annotations and many Hibernate extensions.
The Teneo documentation has a detailed description of the format in which annotations can be specified. The main points are summarized here:
Teneo allows two ways to specify EJB3/JPA-like annotations:
- using the java annotations syntax in EAnnotations (ecore and xsd) (examples)
- a separate xml document (examples).
This page shows examples of both approaches.
JPA Annotations with a TYPE target can be used for EMF EClasses, annotations with METHOD and FIELD targets can be used for EStructuralFeatures. Note: JPA annotations relevant for a non-reference type java member can also be set on an EDataType.
The EAnnotations should adhere to the following format:
- The source must be: teneo.jpa. You can also configure your own annotation source, see Teneo documentation for details.
- The key must be: appinfo or value
See here for examples of how to define eannotations in Ecore or in a XML Schema file.