I'm trying execute following query:
String query = "select entity, entity.id from Site entity";
List resultList = entityManager.createQuery(query).getResultList();
And take exception:
[...]
Caused by: java.sql.SQLException: Fail to convert to internal representation
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.CharCommonAccessor.getLong(CharCommonAccessor.java:239)
at oracle.jdbc.driver.OracleResultSetImpl.getLong(OracleResultSetImpl.java:552)
at oracle.jdbc.driver.OracleResultSet.getLong(OracleResultSet.java:1575)
at org.jboss.resource.adapter.jdbc.WrappedResultSet.getLong(WrappedResultSet.java:724)
at org.hibernate.type.LongType.get(LongType.java:28)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)
at org.hibernate.type.ManyToOneType.hydrate(ManyToOneType.java:103)
at org.hibernate.type.EntityType.nullSafeGet(EntityType.java:204)
at org.hibernate.loader.hql.QueryLoader.getResultColumnOrRow(QueryLoader.java:338)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:606)
at org.hibernate.loader.Loader.doQuery(Loader.java:701)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
... 102 more
What am I doing wrong? Thank you in advance.