New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLQueryFactory .list() with offset and limit causes SQLSyntaxErrorException in Oracle11g #1445

Closed
sarababaei opened this Issue Jul 21, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@sarababaei

sarababaei commented Jul 21, 2015

Code:

QBean<ClearingSetup> clearingSetupQBean = Projections.bean(ClearingSetup.class, qTbClearingSetup.code, qTbClearingSetup.title, qTbClearingSetup.parameterValue);

public List<ClearingSetup> findAllClearingSetups() {
        return sqlQueryFactory.from(qTbClearingSetup)
                .orderBy(qTbClearingSetup.code.desc())
                .limit(3)
                .offset(2)
                .transform(GroupBy.groupBy(qTbClearingSetup.code).list(clearingSetupQBean));
 }

ClearingSetup is a sample type...
qTbClearingSetup is a sample Querydsl query type

Error:
throws com.querydsl.core.QueryException: Caught SQLSyntaxErrorException
causing "ORA-00918: column ambiguously defined" at Oracle level.

without limit and offset, it works correct.
Version: querydsl-core,querydsl-sql : 4.0.2

Full trace:

com.querydsl.core.QueryException: Caught SQLSyntaxErrorException for select * from (
select a.*, rownum rn from (
select TB_CLEARING_SETUP.CODE, TB_CLEARING_SETUP.CODE, TB_CLEARING_SETUP.TITLE, TB_CLEARING_SETUP.PARAMETER_VALUE
from CHK.TB_CLEARING_SETUP TB_CLEARING_SETUP
order by TB_CLEARING_SETUP.CODE desc
) a) where rn > 2 and rownum <= 3
at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50)
at com.querydsl.sql.Configuration.translate(Configuration.java:451)
at com.querydsl.sql.AbstractSQLQuery.iterateSingle(AbstractSQLQuery.java:315)
at com.querydsl.sql.AbstractSQLQuery.iterate(AbstractSQLQuery.java:247)
at com.querydsl.core.group.GroupByList.transform(GroupByList.java:53)
at com.querydsl.core.group.GroupByList.transform(GroupByList.java:36)
at com.querydsl.core.support.FetchableQueryBase.transform(FetchableQueryBase.java:55)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment