-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Collections of dependent objects
PostPosted: Wed Oct 25, 2006 11:58 am 
Senior
Senior

Joined: Mon Oct 23, 2006 5:12 am
Posts: 141
Location: Galicia, Spain
Hibernate version: 3.2

Hi, in section 8.2 (Collections of dependent objects) we can see:

<set name="someNames" table="some_names" lazy="true">
<key column="id"/>
<composite-element class="eg.Name"> <!-- class attribute required -->
<property name="initial"/>
<property name="first"/>
<property name="last"/>
</composite-element>
</set>

My question is: can i define an unique-key fomed by the "id" and the "initial" columns on the join table "some_names"?

I've tried with no luck:

<set name="someNames" table="some_names" lazy="true">
<key column="id"/ unique-key="key1">
<composite-element class="eg.Name"> <!-- class attribute required -->
<property name="initial" unique-key="key1"/>
<property name="first"/>
<property name="last"/>
</composite-element>
</set>

With this config Hibernate complains:

Error parsing XML: XML InputStream(28) Attribute "unique-key" must be declared for element type "key".

Is there any easy way of achieving what i'm looking for?

_________________
andresgr (--don't forget to rate)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.