Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0.4
-
Fix Version/s: None
-
Component/s: Data binding
-
Environment:Mac OS 10.8.1, java "1.6.0_33"
Description
If a domain class has an id field with a name other than 'id', which is mapped appropriately in the mapping block, the Class.get(id) method is converting the id to a Long before submitting to Hibernate, which is causing an error, like
Class org.hibernate.TypeMismatchException
Message Provided id of the wrong type for class tmmweb.StorageFile.
Expected: class java.lang.Integer, got class java.lang.Long`
This appears to be related to some older bugs with other types for an id field named 'id', but may not have been fixed when the id field has a different name.
I don't think this is a bug. Question answered on Stackoverflow http://stackoverflow.com/a/12242791/166062