Order of operations

When you save an instance of a complex entity such as Employee which may have associations to several other entities, NHibernate has to do a lot of work to figure out how to insert/update/delete particular database records. It is important to not only generate correct set of SQL statements to get the work done, but it is even more important to fire these SQL statements in right order. With complex database table structures with lot of foreign key associations, it may be daunting to figure out right order of running a set of SQL statements. NHibernate makes the job easy for us by using the following order to ensure that SQL statements always go in right order:

  1. All entity insertions in the same order they were passed into the ...

Get Learning NHibernate 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.