jpql - java.sql.SQLException: Fail to convert to internal representation -


i'm trying execute following query:

string query = "select entity, entity.id site entity"; list resultlist = entitymanager.createquery(query).getresultlist(); 

and take exception:

[...] caused by: java.sql.sqlexception: fail convert internal representation     @ oracle.jdbc.driver.databaseerror.throwsqlexception(databaseerror.java:112)     @ oracle.jdbc.driver.databaseerror.throwsqlexception(databaseerror.java:146)     @ oracle.jdbc.driver.databaseerror.throwsqlexception(databaseerror.java:208)     @ oracle.jdbc.driver.charcommonaccessor.getlong(charcommonaccessor.java:239)     @ oracle.jdbc.driver.oracleresultsetimpl.getlong(oracleresultsetimpl.java:552)     @ oracle.jdbc.driver.oracleresultset.getlong(oracleresultset.java:1575)     @ org.jboss.resource.adapter.jdbc.wrappedresultset.getlong(wrappedresultset.java:724)     @ org.hibernate.type.longtype.get(longtype.java:28)     @ org.hibernate.type.nullabletype.nullsafeget(nullabletype.java:163)     @ org.hibernate.type.nullabletype.nullsafeget(nullabletype.java:154)     @ org.hibernate.type.manytoonetype.hydrate(manytoonetype.java:103)     @ org.hibernate.type.entitytype.nullsafeget(entitytype.java:204)     @ org.hibernate.loader.hql.queryloader.getresultcolumnorrow(queryloader.java:338)     @ org.hibernate.loader.loader.getrowfromresultset(loader.java:606)     @ org.hibernate.loader.loader.doquery(loader.java:701)     @ org.hibernate.loader.loader.doqueryandinitializenonlazycollections(loader.java:236)     @ org.hibernate.loader.loader.dolist(loader.java:2220)     ... 102 more 

what doing wrong? thank in advance.

your data types mismatched when retrieving field values. check code , ensure each field retrieving java object matches type. example, retrieving date , int. if doing select * possible change in fields of table has happened causing error occur. sql should select fields want in order avoid error.

hope helps.


Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -