Deleting a Collection with NHibernate Using the Criteria API?

Not with Criteria, but it's easy to do with HQL.

Not with Criteria, but it's easy to do with HQL: session. CreateQuery("delete Customer customer where customer in (:customers)") . SetParameterList("customers", customers.ToArray()) .ExecuteUpdate(); But you don't need to load them.

You can also do it in one shot: session. CreateQuery("delete Customer where Name = 'Steve'") .ExecuteUpdate().

I would have thought that the latter is valid.

Unfortunately it doesn't appear to be – lomaxx May 1 '10 at 11:37 i'll check how we do it. – Preet Sangha May 2 '10 at 4:18.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions