Hi,
In our project, we need to instantiate all JPA entities by Google Guice. a) For the JPA entity object, we are implementing the instanstiate method of HibernateProxyInterceptor, to instantiate JPA entities. b) But for the embedded object inside jpa entity, we don't know how to get control of instantiation.
For exmaple: @Entity public class A {
@Embedded private B b; }
We have researched out that the embedded object is instantiated by PojoComponentTuplizer which builds the Instantiator inside, and it can be extended and customized to do instantiation for embedded objects.
Even we create a customized PojoComponentTuplizer, but it's created by Hibernate, the Guice injector is unable to injected, unable to get injector to instantiate the embedded object. Is any other way to get control of instantiate the embedded object? Very appreciate your help!
|