Yes, I must admit the way my query was posted was pretty generic. At this point, it's just hard to decide what detail to put down.
And no, I haven't tried configuring "cascade" via annotations. I just assumed that xml config being the older, it would be more mature. I'll give it a try, but I can't figure out why the former wouldn't work.
For additional info, here's what I have:
Code:
class A {
long id;
String name;
}
class B {
long id;
String name;
}
class C {
long id;
Map<B, A> transition;
}
class D {
long id;
Map<A, C> transitionTable;
}
And XML mapping:
Code:
<class name="C" table="C">
<id name="id">
<generator class="sequence" />
</id>
<map name="transitions" table="B_TO_A" cascade="all,delete-orphan">
<key column="TRANSITIONS_ID" />
<index-many-to-many class="B" column="B_ID" />
<many-to-many column="A_ID" class="A" />
</map>
</class>
<class name="D" table="D">
<id name="id">
<generator class="sequence" />
</id>
<map name="transitionTable" table="A_TO_C"
cascade="all,delete-orphan">
<key column="TRANSITION_TABLE_ID" />
<index-many-to-many class="A" column="A_ID">
</index-many-to-many>
<many-to-many class="C" column="C_ID" />
</map>
</class>