开发者

What is IDetachedQuery and its difference with DetachedCriteria?

开发者 https://www.devze.com 2023-01-19 23:30 出处:网络
What is IDetachedQuery and its difference with DetachedCriteria? How and when IDetached开发者_JAVA技巧Query is used?

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

精彩评论

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