开发者

What is IDetachedQuery and its difference with DetachedCriteria?

What is IDetachedQuery and its difference with DetachedCriteria? How and when IDetached开发者_JAVA技巧Query is used?

UPDATE:

I'm using NHibernate 2.1.2.4000


IDetachedQuery is an interface implemented by DetachedQuery and DetachedNamedQuery.

DetachedQuery is like DetachedCriteria, but for HQL queries. DetachedNamedQuery is for named queries.

As far as I know you don't use the interface directly. Example of DetachedQuery:

var deleteQuery = new DetachedQuery("DELETE FROM myObject o WHERE o.Id = IN (:idList)")
                            .SetParameterList("idList", list);
deleteQuery.GetExecutableQuery(session).ExecuteUpdate();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜