Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Setting a 'unique' constraint on a many-to-one reference in hibernate
[Teneo] Setting a 'unique' constraint on a many-to-one reference in hibernate [message #601966] Fri, 02 February 2007 06:17
Eclipse UserFriend
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&quot;true=
&quot;)"/>
</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
Previous Topic:teneo: Yet another DuplicateMappingException problem
Next Topic:[Teneo] Newbie question: Do I really have to register all my packages to Teneo manually? (using data
Goto Forum:
  


Current Time: Fri Apr 26 16:16:52 GMT 2024

Powered by FUDForum. Page generated in 0.03044 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top