-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Session Factory Interceptor
PostPosted: Thu Feb 12, 2009 12:10 pm 
Newbie

Joined: Thu Jan 24, 2008 3:45 pm
Posts: 2
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.