Problem with Mapping Domain Class to a Legacy Database

I

iparkin

Guest
I am trying to connect to a legacy database table with the following schema
Name Null Type
--------------------- -------- -----------------
STVXXXX_CODE NOT NULL VARCHAR2(2 CHAR)
STVXXXX_DESC NOT NULL VARCHAR2(30 CHAR)
STVXXXX_ACTIVITY_DATE NOT NULL DATE
STVXXXX_SURROGATE_ID NUMBER(19)
STVXXXX_VERSION NUMBER(19)
STVXXXX_USER_ID VARCHAR2(30 CHAR)
STVXXXX_DATA_ORIGIN VARCHAR2(30 CHAR)
STVXXXX_VPDI_CODE VARCHAR2(6 CHAR)

my domain class is as follows

class Stvxxxx {
//private static final String CNST_TABLE_NAME = 'STVXXXX'
String stvxxxx_code
String stvxxxx_desc
Date stvxxxx_activity_date
Long stvxxxx_surrogate_id
Long stvxxxx_version
String stvxxxx_user_id
String stvxxxx_data_origin
String stvxxxx_vpdi_code

static constraints = {
}

static mapping = {
table name:"STVXXXX", schema:"SATXXX" //t.CNST_TABLE_NAME
//version = true
id generator:'identity', stvxxxx_code column: 'STVXXXX_CODE'
columns{
stvxxxx_desc column: 'STVXXXX_DESC'
stvxxxx_activity_date column: 'STVXXXX_ACTIVITY_DATE'
stvxxxx_surrogate_id column: 'STVXXXX_SURROGATE_ID'
stvxxxx_version column: 'STVXXXX_VERSION'
stvxxxx_user_id column: 'STVXXXX_USER_ID'
stvxxxx_data_origin column: 'STVXXXX_DATA_ORIGIN'
stvxxxx_vpdi_code column: 'STVXXXX_VPDI_CODE'
}
}
}

I get the following error

Error 2013-02-13 01:31:55,654 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error executing bootstraps: Error evaluating ORM mappings block for domain [bantest.Stvadmt]: No such property: version for class: org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
Message: Error evaluating ORM mappings block for domain [bantest.Stvadmt]: No such property: version for class: org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
Line | Method
->> 736 | invokeBeanDefiningClosure in grails.spring.BeanBuilder
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 569 | beans in ''
| 511 | invokeMethod . . . . . . in ''
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . . . . . . . . . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . . . . . . . . . . in ''
^ 662 | run in java.lang.Thread
Caused by MissingPropertyException: No such property: version for class: org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
->> 19 | doCall in bantest.Stvadmt$__clinit__closure2
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 736 | invokeBeanDefiningClosure in grails.spring.BeanBuilder
| 569 | beans . . . . . . . . . . in ''
| 511 | invokeMethod in ''
| 303 | innerRun . . . . . . . . in java.util.concurrent.FutureTask$Sync
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . . . . . . . . . . in java.lang.Thread
 
Top