当我将它与db2一起用于分页时,我的下一页给出了错误 [英] When i am using it with db2 for pagination, my next page is giving error

查看:59
本文介绍了当我将它与db2一起用于分页时,我的下一页给出了错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有db2的spring数据jpa.我的第一套唱片来了.但是当我做下一个时,它给了我错误.我猜可能是因为db2.当我使用索引0时,它工作正常.但是当我使用索引1时,它给了数据访问异常.

I am using spring data jpa with db2. My first set of record is coming. But when i do the next, it is giving me error. I guess it may be because of db2. When I use index 0 it is working fine. But when i use index 1 then it is giving data access exception.

在第二页上,我的可分页对象出现以下错误

On second page I am getting below error my pageable object

Pageable pageable = new PageRequest(2,10,Direction.ASC,"messageId"),由于存在此2(正如所提到的索引应为0),因此引发了以下错误

Pageable pageable = new PageRequest(2, 10, Direction.ASC, "messageId"), because of this 2(As it is mentioning that index should be 0), it is throwing the below error

com.ibm.db2.jcc.am.SqlSyntaxErrorException:DB2 SQL错误:SQLCODE = -199,SQLSTATE = 42601,SQLERRMC = OF; ??([DESC ASC NULL RANGE CONCAT ||/MICROSECONDS MICROSECOND,DRIVER = 3.69.24

com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-199, SQLSTATE=42601, SQLERRMC=OF;??( [ DESC ASC NULLS RANGE CONCAT || / MICROSECONDS MICROSECOND, DRIVER=3.69.24

推荐答案

实际上org.hibernate.dialect.DB2Dialect类会生成无效的查询,这就是为什么它无法通过覆盖其方法来更正查询的原因.

Actually org.hibernate.dialect.DB2Dialect class generates invalid query that why its failing you have to correct query by overiding its method.

replace over( order by order of inner2_)  with over()

这篇关于当我将它与db2一起用于分页时,我的下一页给出了错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆