I have hooked in a Interceptor through the SessionFactory. This is done via spring in the following manner
Code:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<db:DataSource datasource="local"/>
</property>
<property name="configLocation" value="classpath:hibernate.cfg.xml"></property>
<property name="entityInterceptor" ref="customInterceptor"></property>
</bean>
<bean id="customInterceptor" class="com.msdw.onecrm.hibernate.custominterceptors.OneCRMHibernateInterceptor"></bean>
In the interceptor I am overriding the onLoad and OnSave methods. These methods never get called. I am wondering why.
However, the methods preFlush, postFlush and onReCreateCollection are called properly.
As per my understanding when a collection is retrieved the individual elements of the collection should callback the onLoad of the interceptor. If this understanding is correct, then why isn't this happening?
Can anybody throw some light on this?
--Harshal Vaidya