1 Reply Latest reply on Jul 29, 2003 4:09 PM by Juha Lindfors

    CMR PROBLEM. ORA-00904 ERROR !

    ansarim Newbie

      Hi,
      i have an ORA-00904 error in the SQL statement corresponding to the EJB QL query.
      I only have this problem when i use the relationship between my two entities.

      this is the definition of the relationship in the ejb-jar


      <ejb-relation>
      <ejb-relation-name>Equip_type - Register</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Equip_type may have many Register</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>Equip_type</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>registers</cmr-field-name>
      <cmr-field-type>java.util.Set</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Register may have one Equip_type</ejb-relationship-role-name>
      Many
      <relationship-role-source>
      <ejb-name>Register</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>equip_typ</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      </ejb-relation>


      my RegisterBean.java :
      ...
      public abstract Equip_typeLocal getEquip_Typ();
      public abstract void setEquip_Typ(Equip_typeLocal equip_typ);

      my Equip_typeBean.java :
      ...
      public abstract java.util.Set getRegisters();
      public abstract void setRegisters(java.util.Set registers);

      the EJB QL :
      SELECT OBJECT(a) FROM Register as a

      the error :
      11:01:44,929 INFO [TilesRequestProcessor] Tiles definition factory found for request processor ''.
      11:01:44,929 INFO [RequestProcessor] Processing a 'POST' for path '/findregister'
      11:01:45,304 ERROR [LogInterceptor] TransactionRolledbackLocalException, causedBy:
      java.sql.SQLException: ORA-00904: Nom de colonne non valide

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
      at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
      at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
      at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
      at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)
      at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1674)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1870)
      at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
      at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:314)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:289)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:165)
      ...


      thanks !