-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate 2 interceptor configuration via hibernate.cfg.xml?
PostPosted: Fri Jan 04, 2008 3:54 am 
Newbie

Joined: Fri Jan 04, 2008 3:32 am
Posts: 2
I've used an interceptor with Hibernate 3 configured via a specification in persistence.xml:

<properties>
<property name="hibernate.ejb.interceptor" value="learn.WhmInterceptor"/>
</properties>

Is there is a similar mechanism that can be used to configure a Hibernate 2 interceptor in hibernate.cfg.xml or perhaps via Spring?

Or is interceptor configuration via Java code the only option in Hibernate 2?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 3:27 pm 
Newbie

Joined: Fri Jan 04, 2008 3:32 am
Posts: 2
There's a simple solution with Spring -- just set the entityInterceptor property in the SessionFactory:

Code:
<bean id="sessionFactory"
    class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
        ...
       <property name="entityInterceptor">
          <bean class="learn.WhmInterceptor"/>
       </property>
</bean>


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

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.