-->
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: Unique identifiers generation with composite id key
PostPosted: Tue Aug 03, 2004 11:45 am 
Newbie

Joined: Tue Aug 03, 2004 11:34 am
Posts: 8
Hi,

I need to used unique identifiers generation for a key-property part of a composite id.
Unfortunatly there is no <generator> child element for <key-property> nor <composite-id> elements.

But anyway, is it possible to use hibernate unique id generation algorithms to generate a part of the composite id.

Thanks for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 1:10 pm 
Beginner
Beginner

Joined: Thu Jul 22, 2004 2:15 pm
Posts: 35
wouldn't that unique key be your primary key?

I think if you need a unique key, then you should make that the primary key and use a unique constraint to make sure you don't have the duplicate combination...

but it seems like there is some meat in this line in the documentation:

Quote:
You can't use an IdentifierGenerator to generate composite keys. Instead the application must assign its own identifiers

http://www.hibernate.org/hib_docs/refer ... ompositeid

HTH,
Pritpal Dhaliwal


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 05, 2004 10:35 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
May be the following from the wiki is something for you:
http://www.hibernate.org/50.html

I think by using a CompositeUserType you sould be able to generate what ever id you want to have.

HTH
Ernst


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.