blaze-persistence icon indicating copy to clipboard operation
blaze-persistence copied to clipboard

Exception thrown when using subQuery + pagedList

Open test-bin-001 opened this issue 1 year ago • 1 comments

Description

This problem occurs when I query page in a subquery, and only when the dialect is oracle

Actual behavior

Caused by: java.sql.SQLException: 无效的列索引
	at oracle.jdbc.driver.OraclePreparedStatement.setIntInternal(OraclePreparedStatement.java:4955)
	at oracle.jdbc.driver.OraclePreparedStatement.setInt(OraclePreparedStatement.java:4946)
	at oracle.jdbc.driver.OraclePreparedStatementWrapper.setInt(OraclePreparedStatementWrapper.java:201)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setInt(HikariProxyPreparedStatement.java)
select * from (select u1_0.id,u1_0.name,(select count(*) from (select null id,null name  from dual where 1=0 union all (select u1_0.id,u1_0.name from user_test u1_0 where u1_0.id is not null group by u1_0.id,u1_0.name)) u2_0) from (select null id,null name  from dual where 1=0 union all (select u1_0.id,u1_0.name from user_test u1_0 where u1_0.id is not null group by u1_0.id,u1_0.name)) u1_0 order by u1_0.id) where rownum<=?

Steps to reproduce

QUser user = QUser.user;
JPQLNextQueryFactory queryFactory = new BlazeJPAQueryFactory(entityManager, criteriaBuilderFactory);
var userPagedList = queryFactory.select(user).from(select(user).from(user).where(user.id.isNotNull()), user)
        .orderBy(user.id.asc())
        .fetchPage(0, 10);
Assertions.assertNotNull(userPagedList);

Environment

Version: 1.6.9 JPA-Provider: Hibernate 6.2.5.Final DBMS: Oracle 11g Application Server: Spring Boot

test-bin-001 avatar May 27 '24 02:05 test-bin-001

Can you translate the error message to English maybe?

Also, Oracle 11 is not supported anymore and Blaze-Persistence does not provide support for that version either. Please upgrade to the latest supported Oracle version.

beikov avatar Aug 12 '24 14:08 beikov