-->
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.  [ 4 posts ] 
Author Message
 Post subject: NaturalId benefits
PostPosted: Fri Mar 30, 2012 3:10 am 
Newbie

Joined: Fri Mar 30, 2012 12:01 am
Posts: 2
Hi all,
Can anyone please let me know the exact use of naturalId in Hibernate
Is there any benefits to use naturalId ??


Top
 Profile  
 
 Post subject: Re: NaturalId benefits
PostPosted: Fri Mar 30, 2012 3:49 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
NaturalId implementation has vastly changed with hibernate4.1 (see http://in.relation.to/Bloggers/41FeatureLoadingByNaturalId?cid=1932981).
In prior versions the benefit is restricted to Criteria queries in combination with enabled second-level-cache and second-level-query-cache:
by declaring immutable NaturalId's and performin criteria query with the where-condition including exclusively those immutable NaturalId's,
then hibernate reuses an eventually cached-result-set, even if on regarding table in meantime modications has incured
(the check in UpdateTimestampsRegion can simply get skipped in that case).


Top
 Profile  
 
 Post subject: Re: NaturalId benefits
PostPosted: Fri Mar 30, 2012 5:06 am 
Newbie

Joined: Fri Mar 30, 2012 12:01 am
Posts: 2
Thank you very much pb00067 for your reply......
With hibernate 4.1 the its really beneficial to use natural id..............
right now working with it and everything working fine with great performance.........

Thanks once again. :))


Top
 Profile  
 
 Post subject: Re: NaturalId benefits
PostPosted: Fri Mar 30, 2012 5:40 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Hi vishaltambe,

as thank-you please take a look into https://hibernate.onjira.com/browse/HHH-7206
and if you like my improvement request, please vote for it.

regards
G.


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