Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
1.2.1:
I have seen the example of batch update with Hibernate but when I tried to do the same thing in NHibernate there was no method called excuteUpdate against IQuery interface.
Could anyone please tell me whether NHibernate supports execute update or not.
In hibernate the code is :_
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
String hqlVersionedUpdate = "update versioned Customer set name = :newName where name = :oldName";
int updatedEntities = s.createQuery( hqlUpdate )
.setString( "newName", newName )
.setString( "oldName", oldName )
.executeUpdate();
tx.commit();
session.close();
Cheers,
Syed