java.sql.SQLException: ORA-00904: "SUPER0__2"."ID": invalid identifier

Hibernate JIRA | Fabio Tudone | 1 decade ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    I'm having a strange problem in Hibernate 2.0.1 when using the session.createQuery() + query.iterate() APIs. My mapping is the following: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "--//Hibernate/Hibernate Mapping DTD//EN" "hibernate-mapping-2.0.dtd"> <hibernate-mapping auto-import="false" default-cascade="save-update"> <class name="test.model.Super"> <composite-id> <key-property name="id"/> </composite-id> <property name="superAttr"/> <joined-subclass name="test.model.Sub1"> <key> <column name="id"/> </key> <property name="sub1Attr"/> </joined-subclass> <joined-subclass name="test.model.Sub2"> <key> <column name="id"/> </key> <property name="sub2Attr"/> </joined-subclass> </class> </hibernate-mapping> The following code works perfectly: ... Transaction t = s.beginTransaction(); List l = s.find("from test.model.Super o where o.class = test.model.Sub1"); t.commit(); ... On the other hand, the following code hangs: ... Transaction t = s.beginTransaction(); Query q = s.createQuery("from test.model.Super o where o.class = test.model.Sub1"); Iterator it = q.iterate(); while (it.hasNext()) { Object o = it.next(); } t.commit(); ... The following SQL select query is generated by Hibernate upon the q.iterate() call: select super0_.id as x0_0_ from Super super0_ where (case when super0__1.id is not null then 1 when super0__2.id is not null then 2 when super0_.id is not null then 0 end=0 ) And the following exception is thrown by Oracle: [ERROR] JDBCExceptionReporter - -Could not execute query <java.sql.SQLException: ORA-00904: "SUPER0__2"."ID": invalid identifier >java.sql.SQLException: ORA-00904: "SUPER0__2"."ID": invalid identifier at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321) at oracle.jdbc.oci8.OCIDBAccess.parseExecuteDescribe(OCIDBAccess.java:1255) at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:527) at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:62) at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:539) at net.sf.hibernate.hql.QueryTranslator.iterate(QueryTranslator.java:789) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1422) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:64) at test.query.TestQueryIter.main(TestQueryIter.java:58) java.sql.SQLException: ORA-00904: "SUPER0__2"."ID": invalid identifier at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321) at oracle.jdbc.oci8.OCIDBAccess.parseExecuteDescribe(OCIDBAccess.java:1255) at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:527) at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:62) at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:539) at net.sf.hibernate.hql.QueryTranslator.iterate(QueryTranslator.java:789) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1422) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:64) at test.query.TestQueryIter.main(TestQueryIter.java:58) rethrown as net.sf.hibernate.JDBCException: Could not execute query: ORA-00904: "SUPER0__2"."ID": invalid identifier at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1425) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:64) at test.query.TestQueryIter.main(TestQueryIter.java:58)

    Hibernate JIRA | 1 decade ago | Fabio Tudone
    java.sql.SQLException: ORA-00904: "SUPER0__2"."ID": invalid identifier
  2. 0

    I'm having a strange problem in Hibernate 2.0.1 when using the session.createQuery() + query.iterate() APIs. My mapping is the following: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "--//Hibernate/Hibernate Mapping DTD//EN" "hibernate-mapping-2.0.dtd"> <hibernate-mapping auto-import="false" default-cascade="save-update"> <class name="test.model.Super"> <composite-id> <key-property name="id"/> </composite-id> <property name="superAttr"/> <joined-subclass name="test.model.Sub1"> <key> <column name="id"/> </key> <property name="sub1Attr"/> </joined-subclass> <joined-subclass name="test.model.Sub2"> <key> <column name="id"/> </key> <property name="sub2Attr"/> </joined-subclass> </class> </hibernate-mapping> The following code works perfectly: ... Transaction t = s.beginTransaction(); List l = s.find("from test.model.Super o where o.class = test.model.Sub1"); t.commit(); ... On the other hand, the following code hangs: ... Transaction t = s.beginTransaction(); Query q = s.createQuery("from test.model.Super o where o.class = test.model.Sub1"); Iterator it = q.iterate(); while (it.hasNext()) { Object o = it.next(); } t.commit(); ... The following SQL select query is generated by Hibernate upon the q.iterate() call: select super0_.id as x0_0_ from Super super0_ where (case when super0__1.id is not null then 1 when super0__2.id is not null then 2 when super0_.id is not null then 0 end=0 ) And the following exception is thrown by Oracle: [ERROR] JDBCExceptionReporter - -Could not execute query <java.sql.SQLException: ORA-00904: "SUPER0__2"."ID": invalid identifier >java.sql.SQLException: ORA-00904: "SUPER0__2"."ID": invalid identifier at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321) at oracle.jdbc.oci8.OCIDBAccess.parseExecuteDescribe(OCIDBAccess.java:1255) at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:527) at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:62) at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:539) at net.sf.hibernate.hql.QueryTranslator.iterate(QueryTranslator.java:789) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1422) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:64) at test.query.TestQueryIter.main(TestQueryIter.java:58) java.sql.SQLException: ORA-00904: "SUPER0__2"."ID": invalid identifier at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321) at oracle.jdbc.oci8.OCIDBAccess.parseExecuteDescribe(OCIDBAccess.java:1255) at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:527) at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:62) at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:539) at net.sf.hibernate.hql.QueryTranslator.iterate(QueryTranslator.java:789) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1422) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:64) at test.query.TestQueryIter.main(TestQueryIter.java:58) rethrown as net.sf.hibernate.JDBCException: Could not execute query: ORA-00904: "SUPER0__2"."ID": invalid identifier at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1425) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:64) at test.query.TestQueryIter.main(TestQueryIter.java:58)

    Hibernate JIRA | 1 decade ago | Fabio Tudone
    java.sql.SQLException: ORA-00904: "SUPER0__2"."ID": invalid identifier
  3. 0

    can not delete a portlet in a page

    Google Groups | 1 decade ago | cksptw
    java.sql.SQLException: ORA-00933: SQL command not properly ended
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Messaging gateway error

    Oracle Community | 1 decade ago | 219248
    java.sql.SQLException: ORA-00942: Table ou vue inexistante
  6. 0

    Messaging Gateway : 9i + Error in Subscriber

    Oracle Community | 9 years ago | 632825
    java.sql.SQLException: ORA-00942: table or view does not exist

  1. rp 1 times, last 5 months ago
27 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.sql.SQLException

    ORA-00904: "SUPER0__2"."ID": invalid identifier

    at oracle.jdbc.dbaccess.DBError.throwSqlException()
  2. oracle.jdbc.dbaccess
    DBError.throwSqlException
    1. oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    1 frame
  3. oracle.jdbc.oci8
    OCIDBAccess.parseExecuteDescribe
    1. oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321)
    2. oracle.jdbc.oci8.OCIDBAccess.parseExecuteDescribe(OCIDBAccess.java:1255)
    2 frames
  4. Oracle jdbc
    OraclePreparedStatement.executeQuery
    1. oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391)
    2. oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672)
    3. oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
    4. oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:527)
    4 frames
  5. net.sf.hibernate
    QueryImpl.iterate
    1. net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:62)
    2. net.sf.hibernate.loader.Loader.getResultSet(Loader.java:539)
    3. net.sf.hibernate.hql.QueryTranslator.iterate(QueryTranslator.java:789)
    4. net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1422)
    5. net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:64)
    5 frames
  6. test.query
    TestQueryIter.main
    1. test.query.TestQueryIter.main(TestQueryIter.java:58)
    1 frame