I'm implementing a Hibernate 3.2.1 event listener that implements several EventListener interfaces:
public class MyEventListener implements PreDeleteEventListener, PostLoadEventListener, PostInsertEventListener, PostUpdateEventListener, Initializable {
Here is the spring 2.5.6 applicationConfiguration.xml for the event listener:
<bean id="eventListener" class="com.mine.MyEventListener" /> <bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" destroy-method="destroy">
<property name="eventListeners"> <map> <entry key="pre-delete"><ref local="eventListener" /></entry> <entry key="post-insert"><ref local="eventListener" /></entry> <entry key="post-load"><ref local="eventListener" /></entry> <entry key="post-update"><ref local="eventListener" /></entry> </map> </property>
My event listener is not being used as the session's post-load listener. It is being used as the pre-delete, post-insert and post-update listeners.
Stepping through with the debugger, I see the session's post-load listener is a DefaultPostLoadEventListener. I don't understand why my post-load listener is not getting configured as the session's post-load listener.
|