[Teneo] Setting a "unique-key" attribute on a many-to-one association using Eannotations w [message #602333] |
Thu, 08 February 2007 06:34 |
Eclipse User |
|
|
|
Originally posted by: Stephen.Egan.csiro.au
Hi,
Me again. Is there an EAnnotation I can use to set a "unique-key" =
constraint on two "many-to-one" associations in Hibernate? Basically, I=
=
want to generate a mapping similar to the following:
:
:
<many-to-one name=3D"roadGroupMembership" entity-name=3D"user_rgm" =
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-key=3D"user_rgm" =
name=3D"`membership_roadgroupmembership_id`"/>
</many-to-one>
:
:
<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"true">
<column not-null=3D"false" unique-key=3D"user_rgm" =
name=3D"`useraccount_useraccount_id`"/>
</many-to-one>
:
:
Thanks,
Stephen.
|
|
|
Powered by
FUDForum. Page generated in 0.02752 seconds