I will try and explain clearer.
The Buyer and the Recipient being the same have only one record in the database. Changing the name of this Person here changes it for both as they are the same.
C.Services want to be able to add a Person record rather than update the Buyer's details.
setting the cascade to save-update works really well.
My second question was regarding whether NHibernate allows the creation of the Order with the same functionality:
ie
Code:
Order ord = new Order();
ord.Buyer = new Person();
order.Delivery = new Delivery("XYZ", ord.Buyer);
What happens when I call SaveOrUpdate() on this Order.
Ideally I want 1 record in the orders able, 1 in the deliveries table and 1 in the People table.
The other potential is:
Code:
Order ord = new Order();
ord.Buyer = new Person();
order.Delivery = new Delivery("XYZ", new Person());
In this case I want 1 record in the orders able, 1 in the deliveries table and 2 in the People table.
I am tying to learn how to use NHibernate correctly, and this sort of usage is not clear in the documentation to me.
Thanks for your help.