Hi Martin
Thanks for the quick response. I should have made myself a little clearer but it was 2am when I wrote it. I am quite happy with the hierarchical model saving and maintaining referential integrity, that's fine and not a problem.
The problem is with the collections and entities when in memory. The 'UpToParent' property on the child objects do not have a reference to the parent object that created them by default. In your sample if you call Product.UpToSupplierBySupplierID.some_Memeber before or after the save it will do a lazy initialisation and create a new instance of Suppliers and load it from the database by the primary key which it gets from Product.SupplierID.
As the product was added to a collection instantiated by an instance of Suppliers I would expect each child to reference back to parent object that created it, not load up another instance. If you created a collection of Products and loaded it by a query and not hierarchically then fine it should load the supplier as needed.
If you iterate through your 5 Product objects and set the Product.UpToSupplierBySupplierID to your instance of Suppliers without referencing the property first it will error as the private member variable for the parent Supplier is null and it tries to compare it to the value you assigning it to. If you fix the problem by forcing the property to initialise first then when you save any changes you get a StackOverflow exception.
If I you added a property to the Supplier and tried to update it from the Products records using the 'UpTo' property it would not work as you would be creating n instances of Supplier, not much good if that property was some sort of total.
Hopefully that makes my problem a little clearer.
Cheers
Paul