Hi I have a pb with this code :
List list = sess.createQuery(query)
.setFirstResult(pStartRow)
.setMaxResults(pFetchSize)
.list();
Ma requête "query" est une requete simple qui fonctionne TB lorsque je met pStrartRow à 0 mais quand je mets une autre valeur, 2 par exemple, j'ai une erreur
14:43:09,403 DEBUG SQL:310 - select * from ( select row_.*, rownum rownum_ from ( select departemen0_.ID_DEPARTEMENT as ID1_, departemen0_.version as version0_, departemen0_.COD_DEPARTEMENT as COD3_0_, departemen0_.LIBL_DEPARTEMENT as LIBL4_0_, departemen0_.LIBC_DEPARTEMENT as LIBC5_0_, departemen0_.BLN_ACTIF as BLN6_0_, departemen0_.DAT_MODIF as DAT7_0_, departemen0_.ID_UTILISATEUR_MODIF as ID8_0_ from HIBERNATE.DEPARTEMENT departemen0_ where (COD_DEPARTEMENT=11 and BLN_ACTIF=1) ) row_ ) where rownum_ <= ? and rownum_ > ?
Hibernate: select * from ( select row_.*, rownum rownum_ from ( select departemen0_.ID_DEPARTEMENT as ID1_, departemen0_.version as version0_, departemen0_.COD_DEPARTEMENT as COD3_0_, departemen0_.LIBL_DEPARTEMENT as LIBL4_0_, departemen0_.LIBC_DEPARTEMENT as LIBC5_0_, departemen0_.BLN_ACTIF as BLN6_0_, departemen0_.DAT_MODIF as DAT7_0_, departemen0_.ID_UTILISATEUR_MODIF as ID8_0_ from HIBERNATE.DEPARTEMENT departemen0_ where (COD_DEPARTEMENT=11 and BLN_ACTIF=1) ) row_ ) where rownum_ <= ? and rownum_ > ?
14:43:09,413 DEBUG AbstractBatcher:364 - preparing statement
14:43:09,674 DEBUG AbstractBatcher:284 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
14:43:09,674 DEBUG AbstractBatcher:392 - closing statement
14:43:09,694 DEBUG JDBCExceptionReporter:49 - could not execute query [select departemen0_.ID_DEPARTEMENT as ID1_, departemen0_.version as version0_, departemen0_.COD_DEPARTEMENT as COD3_0_, departemen0_.LIBL_DEPARTEMENT as LIBL4_0_, departemen0_.LIBC_DEPARTEMENT as LIBC5_0_, departemen0_.BLN_ACTIF as BLN6_0_, departemen0_.DAT_MODIF as DAT7_0_, departemen0_.ID_UTILISATEUR_MODIF as ID8_0_ from HIBERNATE.DEPARTEMENT departemen0_ where (COD_DEPARTEMENT=11 and BLN_ACTIF=1)]
java.sql.SQLException: ORA-01722: Nombre non valide
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:889)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1681)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1870)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:314)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:118)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1197)
at org.hibernate.loader.Loader.doQuery(Loader.java:366)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:206)
at org.hibernate.loader.Loader.doList(Loader.java:1515)
at org.hibernate.loader.Loader.list(Loader.java:1498)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:268)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:788)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at fr.icdc.dei.fwk.sample.persistance.service.impl.DepartementDAOImpl.findDepartementByCriteria(DepartementDAOImpl.java:169)
at fr.icdc.dei.fwk.test.Test.main(Test.java:57)
14:43:09,704 WARN JDBCExceptionReporter:57 - SQL Error: 1722, SQLState: 42000
14:43:09,714 ERROR JDBCExceptionReporter:58 - ORA-01722: Nombre non valide
Why? please help me!
|