Hi if I for example has the following mapping
<class name="Employee" />
.....
<many-to-one name="Company" class="Company" not-null="true" />
</class>
why can't I use the following transaction?
var company = new Company();
var employee = new Employee();
using(var transaction = session.BeginTransaction())
{
session.Save(company);
session.Save(employee);
transaction.Commit();
}
this will give me exception on session.save(employee); because it
could not find company in db. Can I solve it somehow so I don't need
to have in 2 transactions and not need to let the employee has the
responsibility to save company? (using assigned id, if it has
something to do with it?).
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---