Is it possible to cascade an insert on a one to many bidirectional using
assigned IDs when the FK of the child has a constraint?

E.g.

Customer customer = new Customer();
customer.Id = 1;
Address address = new Address();
address.Id = 1;
customer.Addresses.Add(address);
customerDao.SaveOrUpdate(customer); // want this to insert the customer then
insert the address using the assigned customer ID

I want to see this just perform 2 plain inserts with no updates to apply the
foreign key as that's currently violating fk constraints.
I've set cascade="all" and inverse="true" on the address collection.

Currently we're getting an NHibernate first chance stale state exception?

If it's technically possible I'll send more details but just want to check
if it's even technically possible.

Cheers,

Dan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to