Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
core-3.3.1.GA, annotations-3.4.0.GA
Hello,
I am attempting to map an interface with jpa annotations, and then use an Interceptor to associate the interface to a given implementation. I am following this guide as a basic template:
http://www.hibernate.org/339.html.
However, it appears that my interceptor.instantiate method is never being called, and thus I get an InstantiationException when I try to merge my objects.
When looking through the DefaultMergeEventListener code, line 222 is where the instantiation is attempted using the EntityPersister. There is comment in the same location wondering if Session.instantiate() should be called instead of persister.instantiate().
From what I can tell, yes, Session.instantiate() should be used so that the interceptor is applied. However, there appears to be some confusion throughout the code of whether the persister or the session is responsible for calling the interceptor.
Has any more thought been given to this, and is there an acceptable way to get my interceptor.instantiate() method called instead of the persister.instantiate()? As well, can you update / add a tutorial for intercepting entity instantiation?