Batch Update in NHibernate

前端 未结 6 1144
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 09:04

Does batch update command exist in NHibernate? As far as I am aware it doesn\'t. So what\'s the best way to handle this situation? I would like to do the following:

6条回答
  •  不知归路
    2020-11-30 09:20

    I know I'm late to the party on this, but thought you may like to know this is now possible using HQL in NHibernate 2.1+

    session.CreateQuery(@"update Users set Country = 'Antarctica'")
    .ExecuteUpdate();
    

提交回复
热议问题