tenwit wrote:
The reason for the "Of course" is because the inverse="true" attribute means that the parent-to-child association is not a lifecycle-enforcing relationship. That's the whole point of it. If you want cascade="delete" to delete children a collection (as opposted to objects in a simple association), then you use inverse="false": that's what it's for.
Hmm well, I thought "cascade" attribute is the one that defines lifecycle relationship -- Section 10.11 (Transitive persistence) of the reference manual certainly gives that impression, and makes no mention of "inverse" in the context of lifecycle enforcement.
tenwit wrote:
Are you sure that you need inverse="true" on the parent-to-child collection? If you want the childrens' lifecycle to be dependent on the parent, then inverse="true" belongs on the other side of the relationship.
That's exactly what I'm trying to accomplish actually, having the children's lifecycle bound to the parent. The reason I had inverse="true" on the parent side is, well, child side declaration (many-to-one in that case) does not support the inverse attribute. So if there's a way to move inverse="true" declaration to the child side, I can't seem to figure that one out.
I've managed to come up with a working binding with inverse="false" on the parent side, that however still fails to perform a one-shot delete. I've also isolated the behaviour to a simple mapping involving 2 tables and 2 classes only (Parent and Child, adapted from onetomany test-case from the distribution), I can post those if you need to see the specifics.
Thanks,