Anonymous wrote:
thanks for the clue on the internals of NH. that helps in my understanding. in this instance, setting inverse="true" on the bag worked. I guess i'm still not completely understanding the inverse="true" setting...
-d
I think inverse="true" basically means that the objects in the collection only exist as part of the parent.
For example, and Invoice has InvoiceLines. You can't have invoice lines without an Invoice. So, InvoiceLines would be inverse=true. So, when the Invoice is deleted, so are the LineItems.
But, think of Tennent / Unit... The tennent lives in a unit. But, if the tennent moves out the relation ship is broken, but there is still a Unit. The Tennet either moves to a different Unit or he goes away. You wouldn't want to delete the Unit just cause you delete the Tennent.
Another way perhaps to think about it is, if the FK in the child table of the relation ship field allows nulls, the inverse=false. If the FK in the child table is required then you have inverse=true. Of course, there are probably exceptions to this rule.
At least, that is my small minds understanding of them.
BOb