Comming across a wierd situation where my code would work as expected in NH
1.2 but now that I am moving to NH2.1 I am getting
a different behavior when saving an entity, I have cascade="none" for the
Arm mapping, it works fine in NH2.1 if I set cascade="save-update",
really just wanting to see if something has changed between versions causing
this.


var arm = new Arm() { Id = 123 };
var person = new Person() { Name = "Bob", Arm = arm };

Session.Save(person);


NH1.2: You get 1 insert for the person (INSERT INTO PERSON...ArmId=123)
NH2.1: You get 1 select for the arm then an insert(SELECT * FROM ARM WHERE
Id = 1, INSERT INTO PERSON...ArmId=null) <-- because it does not exist.


Cheers
Stefan

--~--~---------~--~----~------------~-------~--~----~
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