[Teneo] Setting a 'unique' constraint on a many-to-one reference in hibernate [message #601966] |
Fri, 02 February 2007 06:17 |
Eclipse User |
|
|
|
Originally posted by: Stephen.Egan.csiro.au
Hi,
I'm trying to add a unique constraint to a many-to-one Ereference in my =
=
ecore model using Eannotaions. I've added the following Eannotation to =
=
the Ereference:
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"userAc=
count" =
eType=3D"#//Support/UserAccount">
<eAnnotations source=3D"teneo.hibernate">
<details key=3D"appinfo" value=3D"@Column(unique=3D"true=
")"/>
</eAnnotations>
</eStructuralFeatures>
This works fine for an Eattribute, but doesn't seem to have any effect o=
n =
the generated hibernate mappings for an EReference:
<many-to-one name=3D"userAccount" entity-name=3D"UserAccount" =
cascade=3D"merge,persist,save-update,lock,refresh" lazy=3D"false" =
insert=3D"true" update=3D"true" not-null=3D"false">
<column not-null=3D"false" unique=3D"false" =
name=3D"`useraccount_useraccount_id`"/>
</many-to-one>
I'm still new to fiddling about with the Eannotations, so please forgive=
=
me if this is a dumb question.
//Stephen
|
|
|
Powered by
FUDForum. Page generated in 0.03044 seconds