Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [Teneo] Setting a "unique-key" attribute on a many-to-one association using Eannotations w
[Teneo] Setting a "unique-key" attribute on a many-to-one association using Eannotations w [message #70892] |
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.
|
|
|
Re: [Teneo] Setting a "unique-key" attribute on a many-to-one association using Eannotatio [message #70910 is a reply to message #70892] |
Thu, 08 February 2007 08:29 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Stephen,
This is supported for eattributes but not yet for ereference (many-to-one). Please enter a bugzilla
for this.
The annotation will then be:
annotation on the eclass:
@Table(name="MYITEMTABLE" uniqueConstraints={@UniqueConstraint(columnNames={"MYSTR", "MYINT"})})
and then you would need a joincolumn annotation on the manytoone to set the names to MYSTR and MYINT.
gr. Martin
Stephen Egan wrote:
> 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="roadGroupMembership" entity-name="user_rgm"
> cascade="merge,persist,save-update,lock,refresh" lazy="false"
> insert="true" update="true" not-null="false">
> <column not-null="false" unique-key="user_rgm"
> name="`membership_roadgroupmembership_id`"/>
> </many-to-one>
> :
> :
>
> <many-to-one name="userAccount" entity-name="UserAccount"
> cascade="merge,persist,save-update,lock,refresh" lazy="false"
> insert="true" update="true" not-null="true">
> <column not-null="false" unique-key="user_rgm"
> name="`useraccount_useraccount_id`"/>
> </many-to-one>
> :
> :
>
> Thanks,
> Stephen.
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo] Setting a "unique-key" attribute on a many-to-one association using Eannotatio [message #70949 is a reply to message #70910] |
Thu, 08 February 2007 11:11 |
Eclipse User |
|
|
|
Originally posted by: Stephen.Egan.csiro.au
Thanks again Martin,
I've logged Bug No. 173429 for this.
//Stephen
On Thu, 08 Feb 2007 19:29:45 +1100, Martin Taal <mtaal@elver.org> wrote:=
> Hi Stephen,
> This is supported for eattributes but not yet for ereference =
> (many-to-one). Please enter a bugzilla for this.
>
> The annotation will then be:
> annotation on the eclass:
> @Table(name=3D"MYITEMTABLE" =
> uniqueConstraints=3D{@UniqueConstraint(columnNames=3D{"MYSTR ","MYINT"}=
)})
>
> and then you would need a joincolumn annotation on the manytoone to se=
t =
> the names to MYSTR and MYINT.
>
> gr. Martin
>
> Stephen Egan wrote:
>> 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.
>
>
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: [Teneo] Setting a "unique-key" attribute on a many-to-one association using Eannotatio [message #602339 is a reply to message #70892] |
Thu, 08 February 2007 08:29 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Stephen,
This is supported for eattributes but not yet for ereference (many-to-one). Please enter a bugzilla
for this.
The annotation will then be:
annotation on the eclass:
@Table(name="MYITEMTABLE" uniqueConstraints={@UniqueConstraint(columnNames={"MYSTR", "MYINT"})})
and then you would need a joincolumn annotation on the manytoone to set the names to MYSTR and MYINT.
gr. Martin
Stephen Egan wrote:
> 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="roadGroupMembership" entity-name="user_rgm"
> cascade="merge,persist,save-update,lock,refresh" lazy="false"
> insert="true" update="true" not-null="false">
> <column not-null="false" unique-key="user_rgm"
> name="`membership_roadgroupmembership_id`"/>
> </many-to-one>
> :
> :
>
> <many-to-one name="userAccount" entity-name="UserAccount"
> cascade="merge,persist,save-update,lock,refresh" lazy="false"
> insert="true" update="true" not-null="true">
> <column not-null="false" unique-key="user_rgm"
> name="`useraccount_useraccount_id`"/>
> </many-to-one>
> :
> :
>
> Thanks,
> Stephen.
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo] Setting a "unique-key" attribute on a many-to-one association using Eannotatio [message #602348 is a reply to message #70910] |
Thu, 08 February 2007 11:11 |
Stephen Egan Messages: 21 Registered: July 2009 |
Junior Member |
|
|
Thanks again Martin,
I've logged Bug No. 173429 for this.
//Stephen
On Thu, 08 Feb 2007 19:29:45 +1100, Martin Taal <mtaal@elver.org> wrote:=
> Hi Stephen,
> This is supported for eattributes but not yet for ereference =
> (many-to-one). Please enter a bugzilla for this.
>
> The annotation will then be:
> annotation on the eclass:
> @Table(name=3D"MYITEMTABLE" =
> uniqueConstraints=3D{@UniqueConstraint(columnNames=3D{"MYSTR ","MYINT"}=
)})
>
> and then you would need a joincolumn annotation on the manytoone to se=
t =
> the names to MYSTR and MYINT.
>
> gr. Martin
>
> Stephen Egan wrote:
>> 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.
>
>
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Goto Forum:
Current Time: Sat Nov 09 23:12:06 GMT 2024
Powered by FUDForum. Page generated in 0.02879 seconds
|