[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4751) Fix for @embeddedid error: Type not supported: org.hibernate.type.ManyToOneType

David Coleman (JIRA) noreply at atlassian.com
Fri Feb 5 06:51:29 EST 2010


Fix for @embeddedid error: Type not supported: org.hibernate.type.ManyToOneType 
--------------------------------------------------------------------------------

                 Key: HHH-4751
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4751
             Project: Hibernate Core
          Issue Type: Improvement
          Components: envers
            Reporter: David Coleman
            Priority: Minor
         Attachments: IDMetadataGenerator_patch.txt

Hi,

After creating hibernate entities from the legacy database with envers hibernate tool, I noticed the following error occurred on creating an audit tables that has an @EmbeddedId attribute (related to ENVERS-76]:

Caused by: org.hibernate.MappingException: Type not supported: org.hibernate.type.ManyToOneType  ..

I found out by looking at the source that the reason it failed was that the property type was not an instance of ImmutableType (not mutable); which was true as the embedded id was a combination of an int and a mutable java data object. I switched the mutable java date object to a immutable joda datetime object using the joda date time hibernate user type to fix the immutable problem.

I also patched IdMetadataGenerator locally to the one attached as hibernate usertypes do not implement the ImmutableType interface; using the method 'isMutable()' should be suffice.

Let me know if this is okay so I can submit the patch.


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