-->
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.  [ 2 posts ] 
Author Message
 Post subject: All fields in object are primary key
PostPosted: Wed Mar 29, 2006 12:46 pm 
Newbie

Joined: Wed Mar 29, 2006 12:42 pm
Posts: 1
Hi
How can I map an object which has to fields (ints) and both of them together are the primary key of the object ?

One way I thought about is to define a new object which includes the two keys and use it as composite-id, but that means that i will have to objects which are the same object but one of them is the key for the other....

I want a much more elegant solution.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 29, 2006 1:13 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
<class name="MyClass" table="my_classes">
<composite-id>
<key-property name="prop1"/>
<key-property name="prop2"/>
</composite-id>
</class>

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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

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.