Hi,
I am trying to use an Interceptor to capture changes to my objects. This is working great on all changes except updates to lists.
If I have an Object like the following :
Code:
public class Company implements PolicyContainer {
private int companyId;
private String companyName;
private List aList;
....
}
where aList is mapped into a bag
Code:
<class name="Company" table="company" select-before-update="true" >
<id name="id" type="int" column="companyID" unsaved-value="0">
<generator class="native"/>
</id>
<bag name="aList" table="aListTable" cascade="all">
<key column="companyID"/>
<composite-element class="aListClass">
<property name="id" column="id" type="int" />
<property name="fred" column="fred" type="string"/>
</composite-element>
</bag>
</class>
If I alter the companyName attribute on a company object then flush() the session then the Interceptor.onFlushDirty() method is called.
If however I add a new aListClass object to the aList list and flush() the session then the Interceptor.onFlushDirty() method is not called.
This seems wrong to me. Have I done something wrong or is it a bug?
I am running Hibernate version 3.0.5, 25 May 2005 with JDK1.5.0_02.
Code: