I'm trying to define a CompositeUserType to handle a specific type in my JPA/Hibernate app. I have a CompositeUserType called ApplicationMessageType that is designed to handle my mapping.
According to what I've read, I should be able to create a package-info.java class in my domain hierarchy that contains the TypeDefs. Mine looks like this:
@TypeDefs({
@TypeDef(
defaultForType = ApplicationMessage.class,
typeClass = ApplicationMessageType.class
)
})
package mptstp.domain;
import mptstp.domain.messages.ApplicationMessage;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;
If I understand correctly, the fact that I'm using the defaultForType parameter to the TypeDef, anytime I attempt to save or load an ApplicationMessage, the custom type code should be called.
I've set breakpoints on every method within the ApplicationMessageType class, and none of them ever get called.
Does anyone have any idea where I've gone wrong? The code compiles, but it appears that the TypeDef annotations never got called to register the ApplicationMessageType.
Any pointers would be greatly appreciated...
Thanks