Caused by: java.sql.SQLException: Fail to convert to internal representation at oracle.jdbc.driver.CharCommonAccessor.getInt(CharCommonAccessor.java:147) at oracle.jdbc.driver.T4CCharAccessor.getInt(T4CCharAccessor.java:726) at oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:896) at com.avaje.ebeaninternal.server.type.RsetDataReader.getInt(RsetDataReader.java:135) at com.avaje.ebeaninternal.server.type.ScalarTypeInteger.read(ScalarTypeInteger.java:52) at com.avaje.ebeaninternal.server.type.ScalarTypeInteger.read(ScalarTypeInteger.java:36) at com.avaje.ebeaninternal.server.deploy.BeanProperty.read(BeanProperty.java:631) at com.avaje.ebeaninternal.server.deploy.id.IdBinderSimple.read(IdBinderSimple.java:190) at com.avaje.ebeaninternal.server.deploy.BeanPropertyAssocOne$Reference.read(BeanPropertyAssocOne.java:729) at com.avaje.ebeaninternal.server.deploy.BeanPropertyAssocOne.read(BeanPropertyAssocOne.java:549) at com.avaje.ebeaninternal.server.query.SqlBeanLoad.load(SqlBeanLoad.java:118) ... 36 more
This is caused by the use of rownum with rawSql via using maxRows and/or firstRow.
For oracle an extra column (rownum) is added to implement the max rows limit and this needs to be taken into account when reading the results from the raw jdbc result.
fixed in HEAD.