Getting exception oracle.rdb.jdbc.common.RdbException: Invalid column name on user's custom native SQL Queries in EAP 6
Issue
- While migrating from
EAP5toEAP6user encountered below exception on the custom native SQL Queries:
getEntityManager().createNativeQuery("select SUM (test) from TestDB").getSingleResult();
- We are using
native query, we are gettingInvalid Column Nameat the point is about the functionsum()
Caused by: oracle.rdb.jdbc.common.RdbException: Invalid column name
at oracle.rdb.jdbc.common.ResultSetMetaData.getColumn(ResultSetMetaData.java:952)
at oracle.rdb.jdbc.common.ResultSet.findCol(ResultSet.java:4721)
at oracle.rdb.jdbc.common.ResultSet.getBigDecimal(ResultSet.java:2294)
at org.hibernate.type.descriptor.sql.DecimalTypeDescriptor$2.doExtract(DecimalTypeDescriptor.java:67)
at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:265)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:261)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:256)
at org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.extract(CustomLoader.java:590)
at org.hibernate.loader.custom.CustomLoader$ResultRowProcessor.buildResultRow(CustomLoader.java:537)
at org.hibernate.loader.custom.CustomLoader$ResultRowProcessor.buildResultRow(CustomLoader.java:516)
at org.hibernate.loader.custom.CustomLoader.getResultColumnOrRow(CustomLoader.java:413)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:747)
at org.hibernate.loader.Loader.processResultSet(Loader.java:949)
at org.hibernate.loader.Loader.doQuery(Loader.java:917)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
at org.hibernate.loader.Loader.doList(Loader.java:2550)
at org.hibernate.loader.Loader.doList(Loader.java:2536)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366)
at org.hibernate.loader.Loader.list(Loader.java:2361)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:340)
at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1788)
at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:232)
at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:157)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:287)
.......
10:58:20,770 WARN [main] [SqlExceptionHelper] SQL Error: 17006, SQLState: S1000
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.4.3
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
