Reputation: 455
I have an entity which contains several sets/bags. is there any recommendation from NHibernate on how to delete it? of course I can do foreach on each list and delete each child, but that will create many delete statements. is it better to create HQL for each child table, or maybe other approach? I've also seen on another thread to use IStatelessSession. is it wise here?
Upvotes: 0
Views: 63
Reputation: 22424
Personally I think HQL
works well in this instance.
Or if your stomach can take it use cascading deletion
at the database level then delete the parent and the children precede automatically.
Upvotes: 1