-->
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: general question : best practice.
PostPosted: Wed Apr 09, 2008 1:10 am 
Regular
Regular

Joined: Tue Apr 01, 2008 5:39 pm
Posts: 61
I was wondering when it would be good to map natural-id and when it would be good to map composite-id?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 10, 2008 2:45 am 
Regular
Regular

Joined: Mon Aug 06, 2007 10:49 am
Posts: 67
Location: Banska Bystrica, Slovakia
natural-id is good when u use 2nd level caching and u want to look up object based on natural id so there will be no query cache in this case but object will be loaded from cache as is usual for retrieval by its identifier

about composite-id: i prefer not to use composite id, just caused more trouble then usage for me


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 10, 2008 10:06 am 
Newbie

Joined: Tue Jan 22, 2008 9:53 am
Posts: 18
I have used the composite ID successfully when i need to, But i have an advice. Avoid to use composite-id when you need an automatic generator for this id as a sequence for example. It's really problematic with generators.

hope it helps you to take your decision


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.