6 Replies Latest reply on Oct 4, 2012 5:46 AM by Max Rydahl Andersen

    Hibernate tools - Reverse Engineering - Issue with ID class equals method for BigDecimal fields

    purna chand cherukuri Newbie



      I am using Hibernate tools of version 3.2.4.


      When I reverse engineer the tables, the composite keys are getting created as separate Id classes which is correct.

      But the issue is with the equals method of ID class. 

      In equals method, for BigDecimal fields, it is generating equals only instead of compareTo.



      I found this issue as resolved in JIRA( https://hibernate.onjira.com/browse/HBX-400 ).  But it doesnt seem like working for me as expected.



      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.  Please suggest the solution for this.


      Thanks in advance.