[Teneo] Annotation in ecore model (foreign key and annotation for options) [message #616106] |
Tue, 08 April 2008 17:49 |
Torsten Link Messages: 51 Registered: July 2009 |
Member |
|
|
Hi,
--------------------------------------------------------
1. FOREIGN_KEY Annotation:
--------------------------------------------------------
I Have the following Model.
A Class Library contains many Books. Containment Reference.
The foreignKey in the book table is library_id.
Now I would like to set an Annotation in the ecore which defines that
the Relation is a bag not a list and the foreignKey Column name is
'library_id'.
I tried the following Annotation (I tried also many more ...) but it
does not work.
<eStructuralFeatures
xsi:type="ecore:EReference"
name="books"
upperBound="-1"
eType="#//IBook"
containment="true">
<eAnnotations source="teneo.jpa">
<details
key="appinfo"
value="@OneToMany(mappedBy=library_id)"/>
</eAnnotations>
</eStructuralFeatures>
--------------------------------------------------------
2. Could I set the following Options also as Annotation?
--------------------------------------------------------
PersistenceOptions.ALWAYS_MAP_LIST_AS_BAG
PersistenceOptions.SQL_NAME_ESCAPE_CHARACTER
PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH
PersistenceOptions.ALWAYS_VERSION
or how could I define it for each relation
Thank you in advance
Torsten Link
|
|
|
Powered by
FUDForum. Page generated in 0.02755 seconds