-->
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: why hibernate tools is not generating hashcode()/equals()
PostPosted: Thu Jun 23, 2011 9:00 am 
Newbie

Joined: Thu Jun 23, 2011 8:56 am
Posts: 2
i tried either eclipse 3.6.2 version or 3.4.2,
none generated hashcode()/equals(),
i've one to many collections which indeed need them;

while old middlegen can generate it correctly,
any suggestion?


Top
 Profile  
 
 Post subject: Re: why hibernate tools is not generating hashcode()/equals()
PostPosted: Fri Jun 24, 2011 8:08 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
The hashCode and equals will be generated if you use any property with
"use-in-equals" meta attribute set to true or if you use <natural-id> in class.

Are you sure you have the same mapping which generates the methods in old hibernate-tools version?

You can add "use-in-equals" meta attribute as a workaround, but if there is really a problem please create an issue in our jira.


Top
 Profile  
 
 Post subject: Re: why hibernate tools is not generating hashcode()/equals()
PostPosted: Fri Jun 24, 2011 9:53 am 
Newbie

Joined: Thu Jun 23, 2011 8:56 am
Posts: 2
Dmitry Geraskov wrote:
The hashCode and equals will be generated if you use any property with
"use-in-equals" meta attribute set to true or if you use <natural-id> in class.

Are you sure you have the same mapping which generates the methods in old hibernate-tools version?

You can add "use-in-equals" meta attribute as a workaround, but if there is really a problem please create an issue in our jira.

well, in old way i use middlegen to connect db and generate hbm.xml and pojo using 2 steps, in the middle i did not modify any thing for turn around,
i'm expecting eclipse plugin will do the same for hbm.xml and pojo (no need to add a meta for workaround), but failed,
my question to all you is:
do you get those hashcode() equals generated using eclipse plugin?


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.