-->
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.  [ 3 posts ] 
Author Message
 Post subject: Multiple primary keys on a single table
PostPosted: Thu May 18, 2006 10:22 am 
Newbie

Joined: Thu May 18, 2006 10:17 am
Posts: 2
Hi all,
i'm using hibernate 3.1.3 and would like to know if it's possible to have multiple primary keys in one single entity and how to define them with the mappings file? Could you point me to some documentation about it?

Thanks for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 10:33 am 
Newbie

Joined: Wed May 17, 2006 6:06 pm
Posts: 8
You can only have one primary key by definition. You may have multiple columns that are specified to make up the primary key.

If your primary key has multiple columns look for the composite-id section of the Hibernate_reference.pdf file. It has an example of how to map that.

dynoweb
remember to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 10:42 am 
Newbie

Joined: Thu May 18, 2006 10:17 am
Posts: 2
thanks for the reply, and for the clarification, i'll look into it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.