[hibernate-issues] [Hibernate-JIRA] Created: (HHH-7310) Resolution of types registered in type registry does not work properly for Properties of @Embeddable types

Chris Pheby (JIRA) noreply at atlassian.com
Wed May 9 21:13:11 EDT 2012


Resolution of types registered in type registry does not work properly for Properties of @Embeddable types
----------------------------------------------------------------------------------------------------------

                 Key: HHH-7310
                 URL: https://hibernate.onjira.com/browse/HHH-7310
             Project: Hibernate ORM
          Issue Type: Bug
          Components: core
    Affects Versions: 4.1.3
         Environment: Any
            Reporter: Chris Pheby


The new type registry capability in Hibernate 4 and above is really useful. I have implemented an integrator that autoregisters some types, however what I have found is that whilst this works perfectly, the registered types are not being resolved correctly when they are used within @Embeddable classes.

This is easily reproduced: for example, using Jadira Usertype (usertype.sourceforge.net), setting the system property to autoregister types and updating a test class to use @Embeddable triggers the problem.

The problem occurs because the types are first initialised during a call to Configuration validate(). This occurs before any integrators are invoked and consequently types that will be mapped by the integrator at that time are mapped to either their existing basic type or Serializable. They are only remapped on future calls to getType on the type (such as within heuristic type).

The resolution of the issue lies in removing the caching from Component because in the case of Component types these are not remapped on repeated calls to getType.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list