Announcement Announcement Module
Collapse
No announcement yet.
Getting error ORA-00904: "THIS_". on model Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting error ORA-00904: "THIS_". on model

    I am wiring 2 pre existing (hibernate) model classes to my Gails 1.3 app.
    I get this error on both model classes. Interestingly in both cases the
    error is flagged on the last column in each table.

    How can I resolve this?

    Here is one error msg in full and corresponding model class.

    Error 500: Executing action[list] of controller [org.hbsp.cl.hwf.model.HMMModuleController] caused exception: could not execute query; SQL [select this_.module_id as module1_2_0_, this_.abbreviation as abbrevia2_2_0_, this_.forum_id as forum3_2_0_, this_.name as name2_0_, this_.path as path2_0_, this_.product_id as product6_2_0_, this_.product_name as product7_2_0_ from hmm_module this_]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
    Servlet: grails
    URI: /mmt_admin/grails/HMMModule/list.dispatch
    Exception Message: ORA-00904: "THIS_"."PRODUCT_NAME": invalid identifier
    Caused by: ORA-00904: "THIS_"."PRODUCT_NAME": invalid identifier
    Class: HMMModuleController
    At Line: [13]


    java.sql.SQLSyntaxErrorException: ORA-00904: "THIS_"."PRODUCT_NAME": invalid identifier


    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoe r.java:440)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoe r.java:396)

    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall. java:837)

    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.jav a:445)

    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java: 191)

    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:5 23)

    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4 CPreparedStatement.java:207)

    at oracle.jdbc.driver.T4CPreparedStatement.executeFor Describe(T4CPreparedStatement.java:863)

    at oracle.jdbc.driver.OracleStatement.executeMaybeDes cribe(OracleStatement.java:1153)
    :
    :



    @Entity
    @Table(name = "HMM_MODULE")
    public class HMMModule implements Serializable {
    :
    :

    @Column(name = "product_name", length = 12, nullable = false)
    private String productName;

    public HMMModule() {
    }

    :
    :

    public void setProductName(String productName) {
    this.productName = productName;
    }

    public String getProductName() {
    return productName;
    }

    }

  • #2
    Bizarre. The SQL looks fine. Does this Hibernate model works fine in other apps? It looks like a Hibernate/Oracle issue rather than anything specific to Grails. Perhaps a difference in Hibernate versions, JDBC driver or something else.

    Comment


    • #3
      Did you try running the SQL above (from the stack trace) in Oracle? My guess would be that product_name isn't the actual name of the field in the table/view you're working with. Perhaps its aliased as something else.

      Comment

      Working...
      X