What is the best practice for this problem? Is there any batching features built-in?
Sample code:
using (ITransaction transaction = _session.BeginTransa
you can Use HQL to delete multiple objects
Look for delete here - for session.delete example
HQL DELETE example (you can use IN with HQL):
ISession session = sessionFactory.OpenSession();
ITransaction tx = session.BeginTransaction();
String hqlDelete = "delete Customer c where c.name = :oldName";
// or String hqlDelete = "delete Customer where name = :oldName";
int deletedEntities = session.CreateQuery( hqlDelete )
.SetString( "oldName", oldName )
.ExecuteUpdate();
tx.Commit();
session.Close();