-
Jul 4th, 2011, 10:37 AM
#1
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;
}
}
-
Jul 27th, 2011, 04:02 AM
#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.
-
Aug 2nd, 2011, 01:48 PM
#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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules