i think i'm really missing something in how your associations are supposed to work. I _think_ you have:
Owner many-to-one Contact
and the inverse
Contact one-to-many Owner
if that is true, then you have to have the association mapped:
Code:
<class name="Owner">
<many-to-one name="Contact">
</class
<class name="Contact">
<bag name="Owners" lazy="true" inverse="true">
<key column="ContactID" />
<one-to-many class="Owner" />
</bag>
</class>
this particular mapping would require you to do something like:
Code:
Owner o = new Owner();
session.Save(o);
...
Contact c = new Contact();
c.Owners.Add(o);
o.Contact = c;
session.Save(c);
session.Update(o);
but that isn't really very clean. I personally would implement cascade on the Contact class:
Code:
<class name="Contact">
<bag name="Owners" lazy="true" inverse="true" cascade="save-update">
<key column="ContactID" />
<one-to-many class="Owner" />
</bag>
</class>
this would allow you to:
Code:
Owner o = new Owner();
Contact c = new Contact();
c.Owners.Add(o);
o.Contact = c;
session.Save(c);
because the collection is configured to cascade the save and update calls, NH will automagically save the owner first, get the guid, then save the contact with the correct reference to the owner...
am i helping? like i said, i think i'm missing something in your associations...
-devon