Hibernate version: 3.2.5 ga
Hi everyone,
Is there a simmilar event listener method to org.hibernate.Interceptor.findDirty()?
I need to catch all the instances that changed in persistence ctx before it gets flushed to DB.
Need to catch pojo that was changed with something like:
Code:
pojo.setProperty("a");
dao.save(pojo);
I tried to register DirtyCheckEventListener on dirty-check but that will be not called for some reason.
When I save the pojo it does onFlush, onSaveOrUpdate, onFlushEntity.
When I change it, it dirty checks collections from AbstractFlushingEventListener right after onSaveOrUpdate but that's it basically.
I was checking hibernate docs, Java Persistence with Hibernate... no luck.
One more question: I tried to find a state diagram with all the events that are called by core listeners with no luck, has anyone found something like that?
Thanks, Cheers
My spring(2.5.2) app ctx looks currently like this:
Code:
<bean id="xxx.sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="xxx.DataSource" />
<property name="mappingResources">
<list>
<value>a.pojo.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties"
ref="xxx.HibernateProperties" />
<property name="eventListeners" ref="xxx.eventListeners" />
</bean>
<!-- listeners -->
<util:map id="xxx.eventListeners">
<entry key="flush-entity">
<list>
<ref local="DefaultFlushEntityEventListener" />
<ref local="xxx.myListener" />
</list>
</entry>
<entry key="flush">
<list>
<ref local="DefaultFlushEventListener" />
<ref local="xxx.myListener" />
</list>
</entry>
<entry key="save-update">
<list>
<ref local="DefaultSaveOrUpdateEventListener" />
<ref local="xxx.myListener" />
</list>
</entry>
<entry key="dirty-check">
<list>
<ref local="DefaultDirtyCheckEventListener" />
<ref local="xxx.myListener" />
</list>
</entry>
<entry key="delete">
<list>
<ref local="DefaultDeleteEventListener" />
<ref local="xxx.myListener" />
</list>
</entry>
</util:map>