开发者

Update data without retrieving

C开发者_开发百科an NHibernate update some (not all) fields in the table row without retrieving any data? I know Id of the entity.


You can find all the examples here:

http://nhibernate.info/doc/nh/en/index.html#batch-direct


session.CreateQuery("update Foo f set f.Date = :date where f.Id = :id")
    .SetParameter("date", DateTime.Now)
    .SetParameter("id", 25)
    .ExecuteUpdate();


You can do it with HQL

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜