views:

22

answers:

0

My business object scenario is a class A that contains two references to instances of class B.

There are corresponding tables for these classes. Table A has two foreign key link fields to table B. This database structure is set in stone and simply cannot change.

I wish to use fluent-nHibernate to save at the class A level and achieve database insert of both the class A instance and of the two referenced class B instances. I have not managed to tell Fluent-NHibernate that the table B records need to be inserted first in order that the foreign key values be known ready for successful insertion into table A.

Can anyone assist with this problem?

Thanks in advance.

related questions