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: Equals override
PostPosted: Mon Aug 07, 2006 5:47 am 
Beginner
Beginner

Joined: Fri Jul 07, 2006 12:08 pm
Posts: 37
For entity objects,hbernate suggests overriding equals method..should this equality be checked on id? For example,i have a hotel entity..now in my scenario two hotels are same if they have same name and same location..so should check on name/location,or id of entity objects


Top
 Profile  
 
 Post subject: Re: Equals override
PostPosted: Mon Aug 07, 2006 5:57 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
vishyanand wrote:
For entity objects,hbernate suggests overriding equals method..should this equality be checked on id? For example,i have a hotel entity..now in my scenario two hotels are same if they have same name and same location..so should check on name/location,or id of entity objects


http://www.hibernate.org/hib_docs/nhibernate/html/persistent-classes.html#persistent-classes-equalshashcode is pretty explicit about the issue...

Gert

_________________
If a reply helps You, rate it!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 8:06 am 
Beginner
Beginner

Joined: Fri Jul 07, 2006 12:08 pm
Posts: 37
thks gert..


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.