I have already execute the below query in order to create the table ACCOUNT in my Oracle DB:
CREATE TABLE ACCOUNT
( TESTACC VARCHAR2(13 BYTE) NOT NULL,
TEST VARCHAR2(3 BYTE) DEFAULT 'TEST',
CONSTRAINT TEST_PK
PRIMARY KEY
(TESTACC)
)
Then I create a GRAILS domain
class Account {
String testAcc
String test
static constraints = {
testAcc nullable: false
}
static mapping = {
table "ACCOUNT"
id name: "testAcc"
testAcc column: "ID"
test column: "TEST"
}
Now, I am trying to execute the query below in GRAILS console :
Account.executeQuery("select u.test from Account u")
But I facing this issue :
org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: ORA-00904: "ACCOUNT"."TEST": invalid identifier