-->
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.  [ 2 posts ] 
Author Message
 Post subject: Issue with BigDecimal ID's equals method
PostPosted: Sat Sep 22, 2012 9:21 am 
Newbie

Joined: Sat Sep 22, 2012 9:10 am
Posts: 2
Hi,

I am using Hibernate tools of version 3.2.4.

When we reverse engineer the tables, the composite keys are getting created as a separate Id class which is fine.
But the issue is with the equals method of ID class. In equals method, even for BigDecimal fields, it is using equals only instead of using compareTo.

I have verified the Hibernate tools code and it is having a method named useCompareTo()(In BasicPOJOClass.java) where it is checking for BigDecimal. But some how, my flow doesnt seem to go through that construct.

Is there any configuration need to be done to get it corrected?

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Issue with BigDecimal ID's equals method
PostPosted: Sat Sep 22, 2012 12:53 pm 
Newbie

Joined: Sat Sep 22, 2012 9:10 am
Posts: 2
Hi,

I have posted a comment on JIRA issue aderessing the same problem.

https://hibernate.onjira.com/browse/HBX-400

Here is the content posted there.

I still have this issue. When we generate entities from hibernate tools, it is not generating compareTo method for BigDecimal fields.
As I gone through the code, I understood the issue is in useCompareTo() method of BasicPOJOClass.java.
I think it should look for the string "BigDecimal" rather checking for "java.math.BigDecimal"(As the javaTypeName is getting unqualified using StringHelper.unqualify() in ImportContextImpl.importType() method).

Please correct me if my understanding is wrong.


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