Joined: Thu Jul 21, 2005 4:50 am Posts: 5
|
Here is another question regarding batching:
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
int[] ids = <array of ids to delete>
Query q = s.createQuery("delete from MyTable where nodeNo = :nodeNo");
for (int i = 0; i < ids.length; i++ ) {
q.setInteger("nodeNo", nodeNo);
q.executeUpdate();
}
tx.commit();
session.close();
Is this how one would write for batch delete? The ids must be deleted in the same order (due to some constraints).
Thanks.
|
|