I have say a letter object with a collection object containing 1,000 customer objects.
When i add new customer objects to the collection and call flush, it wants to run an sql statment for each insert to persist the customer object and then run a seperate update query for each record to setup the relationships.
This seems very inefficient. Instead of running the insert query and then straight after running the update, is their an option to just do the insert query with the updated values?
Another question. i have the customer collection in the letter setup as lazy loaded. When i delete the letter, the cascade should delete all the customer objects as well which it seems to do in a round about sort of way. When the delete is run, nhibernate first runs select statements to load all the objects before deleting them all. What is the point of that?
Can this be tuned to be more efficient as well?
|