[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6316) Maps with objects as values cannot be used as keys if the hashcode is lazily loaded.

Sumit Raja (JIRA) noreply at atlassian.com
Tue Jun 14 11:51:24 EDT 2011


Maps with objects as values cannot be used as keys if the hashcode is lazily loaded.
------------------------------------------------------------------------------------

                 Key: HHH-6316
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6316
             Project: Hibernate Core
          Issue Type: Bug
    Affects Versions: 3.6.1
         Environment: H2 1.3.153 or MySQL 5.1.x, Linux 2.6.38, Java 1.6.0_24-b07
            Reporter: Sumit Raja
            Priority: Minor
         Attachments: hibernate-test.tgz

When two maps are defined, one containing a type as a value and the other with the same type as key a NPE occurs when doing a get from the type-as-key map, only when the type-as-value map is loaded, but not accessed. The type uses a non-id field for its hash code, which causes the NPE to occur on key insertion.

Attached test case probably explains it better.

-- 
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