Probably it's better to illustrate my question with some code. The entity class looks like this:
Code:
public class ForeignArticleType extends ForeignType {
....
private Set<ForeignArticleType> subArticleTypes = null;
...
.... various get/set methods
}
It is a article type, that holds a collection of sub types (subArticleTypes). The mapping looks like this:
Code:
<class name="ForeignArticleType">
<id name="id" column="FOREIGNARTICLETYPE_ID">
<generator class="native"/>
</id>
... various properties
<set name="subArticleTypes" cascade="save-update,persist,delete" lazy="false">
<key column="PARENT_ID"/>
<one-to-many class="ForeignArticleType"/>
</set>
....
</class>
Given the following situation: I have three article types with the ids 1, 2, 3, 4, whereas element 2 is a child of 1 and and 4 a child of 3 - Element 1 holds element 2 in the collection subArticleTypes. All elements are persisted. Then i add element 2 in 3 as sub type. How do i track this with an interceptor? EmptyInterceptor#onFlushDirty doesn't notice it.
Thanks in advance!
GLA