由网友(佀个废物)分享简介:什么是NHibernate的HQL的相当于T-SQL的TOP关键字?What is NHibernate HQL's Equivalent to T-SQL's TOP Keyword?还什么是非HQL方式说给我的前15个一类?Also what is the non-HQL way for saying giv...
什么是NHibernate的HQL的相当于T-SQL的TOP关键字?
What is NHibernate HQL's Equivalent to T-SQL's TOP Keyword?
还什么是非HQL方式说给我的前15个一类?
Also what is the non-HQL way for saying give me the first 15 of a class?
推荐答案
它实际上是美元的HQL p $ ptty的方便:
It's actually pretty easy in HQL:
var top15 = session.CreateQuery("from SomeEntity")
.SetFirstResult(0)
.SetMaxResults(15)
.List<SomeEntity>();
不知道如何使用标准的API,虽然做到这一点。
Don't know how to do this using the criteria API though.
相关推荐
最新文章