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: is there a better way to impl equals() and hashcode() ?
PostPosted: Fri Aug 18, 2006 4:57 am 
Newbie

Joined: Tue Aug 01, 2006 1:44 am
Posts: 4
Location: Guangzhou, China
as in the pojo, I can't find the unique properties in some case, that is, they might all be the same except the database identifier. I know it's a bad way of using database identifier to impl equals() and hashcode(), is there a better way when I can't determine the "bussiness key"?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 10:48 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
not really

make them use whatever properties you want. Business key is preferable.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 11:16 am 
Newbie

Joined: Thu Aug 17, 2006 5:27 pm
Posts: 4
Location: stjude
If u r using InteliJ, it has the feature to do it for you. If u r using Eclipse, go to http://commonclipse.sourceforge.net/index.html to download plugin.

I never write my own equals and hashcode since I found this plugin.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 22, 2006 11:27 am 
Newbie

Joined: Fri Sep 22, 2006 10:41 am
Posts: 1
I'v just posted a proposal here:
http://www.hibernate.org/109.746.html

as a comment of this great entry:
http://www.hibernate.org/109.html


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.