]
Chris Pheby commented on HHH-7310:
----------------------------------
I've created a pull request with a test and fix - see
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
Labels: typedef
Original Estimate: 1h
Remaining Estimate: 1h
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: