[hibernate-issues] [Hibernate-JIRA] Created: (HBX-1116) Generated hashCode() is inconsistent with equals() when using natural-id tag

Magnus Jungsbluth (JIRA) noreply at atlassian.com
Tue Mar 31 17:12:38 EDT 2009


Generated hashCode() is inconsistent with equals() when using natural-id tag
----------------------------------------------------------------------------

                 Key: HBX-1116
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1116
             Project: Hibernate Tools
          Issue Type: Patch
    Affects Versions: 3.2.4.GA
         Environment: hibernate tools revision 16240
            Reporter: Magnus Jungsbluth
            Priority: Minor
         Attachments: hbm2java_hashCode_equals.patch

when using a natural-id tag in a hbm.xml file, the pojo's generated equals method uses the natural-id properties while the hashcode implementation requires an additional meta-attribute

the included patch uses the same check as in the equals generation in basicpojoclass.java

additionally the template has been changed to only iterate over equalshashcode properties which reduces unnecessary blank lines in the hashcode implementation

the template also contained wrongly indented lines



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list