开发者

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

开发者 https://www.devze.com 2022-12-10 22:55 出处:网络
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 statement

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

精彩评论

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