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-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 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Martin Taal is currently offline Martin TaalFriend
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 Go to previous message
Stephen Egan is currently offline Stephen EganFriend
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/
Previous Topic:[Teneo] Setting a "unique-key" attribute on a many-to-one association using Eannotations w
Next Topic:For those using Teneo from cvs: HEAD is Teneo for EMF 2.3 , Branch: R0_7_maintenance is EMF 2.2
Goto Forum:
  


Current Time: Thu Apr 25 13:12:32 GMT 2024

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

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

Back to the top