Hibernate中分页查询在SQL Server2005产生的SQL语句

Hibernate 的分页代码

 

query.setFirstResult(7682);
query.setMaxResults(10);
List list = query.list(); 

 

通过跟踪数据库检测器,如下

 

declare @p1 int
set @p1=0
declare @p2 int
set @p2=0
declare @p7 int
set @p7 =0
exec sp_cursorprepexec @p1 output,@p2 output,NULL,N'select top 76820 this_.FGuid as FGuid7_0_, this_.FM6 as FM2_7_0_, this_.FcPp as FcPp7_0_, this_.FM1 as
FM4_7_0_, this_.FcXh as FcXh7_0_, this_.FDhh as FDhh7_0_, this_.FcLb as FcLb7_0_, this_.FCBZ as FCBZ7_0_, this_.FcXl as FcXl7_0_, this_.FCdw as FCdw7_0_,
this_.Fd3 as Fd11_7_0_ from bap.dbo.B_CMS_Productinfo this_ where (1=1) order by this_.FGuid asc',8,1,@p7 output
select @p1, @p2, @p7
--exec sp_cursorfetch 180150011,2,0,128
exec sp_cursorfetch 180150011,16,76810,128

 

可以看出hibernate 在sql server 2005的最关键在与存储过程

exec sp_cursorprepexec(Prepare a cursor statement and open)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值