开发者

NHibernate. Is there something like "CreateMultiSQLQuery" for batch SQL Statements

I am using CreateSQLQuery to retrieve some entities with complex criteria an开发者_Python百科d everything works fine with entity retrieval. But I want at the same query to use a Batch of SQL statements having the same result as this HQL Query (Want to make some record Counts) :

IList results = s.CreateMultiQuery()
   .Add("from Item i where i.Id > :id")
   .Add("select count(*) from Item i where i.Id > :id")
   .SetInt32("id", 50)
   .List(); 

Isn't there a way to create something like CreateMultiSQLQuery ? I am using NH 2.1 and SQL 2005.


You can try to adopt Named SQL queries for that purpose.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜