-->
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: Automatic generation of hashcode() and equals()
PostPosted: Thu Apr 26, 2007 6:05 pm 
Senior
Senior

Joined: Sat Apr 21, 2007 11:01 pm
Posts: 144
Is it posible to automaticaly generate hashcode() and equals() in your pojos? I know eclipse will do these for you, but it's anoying have to redo them everytime you have to regen after a schema change.
Has anyone found a nice solution to this?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 26, 2007 8:29 pm 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
Read up on the meta attribute, especially the use-in-equals bit.

Then, you can use a custom ReverseEngineeringStrategy class and override the columnToMetaAttributes(TableIdentifier identifier, String column) method to determine which columns to include.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 27, 2007 5:37 am 
Senior
Senior

Joined: Sat Apr 21, 2007 11:01 pm
Posts: 144
Cheers Ananasi.


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.