-->
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: Composite keys
PostPosted: Fri Apr 09, 2010 3:37 pm 
Newbie

Joined: Thu Apr 08, 2010 11:34 am
Posts: 7
Is it possible to use composite keys where one of the properties can be null?


Top
 Profile  
 
 Post subject: Re: Composite keys
PostPosted: Fri Apr 09, 2010 7:07 pm 
Newbie

Joined: Fri Apr 09, 2010 5:32 pm
Posts: 7
do it !! and answer by yourself


Top
 Profile  
 
 Post subject: Re: Composite keys
PostPosted: Sun Apr 11, 2010 1:55 pm 
Regular
Regular

Joined: Wed Mar 10, 2010 4:48 am
Posts: 106
It is possible, but I won't recommend it.

I've spend a lot of time trying to get it to work.
I wanted a composite key which contained two Foreign keys. I suspect this is possible, but not easy.

I worked around it by using a normal Primary Key, and the foreign keys in a unique property.

If you want to give it a try: http://docs.jboss.org/hibernate/core/3.3/reference/en/html/mapping.html#mapping-declaration-compositeid


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.