How to map the version column of a legacy DB to a domain class.

H

hepower

Guest
I have a legacy DB which have a table A.
In table A it has a column named version with type String.
I want to define a member String version in a Domain class.
but seems the version member in domain class could not mapped with the version column in the legacy DB.
Any one know how to make it works?

Thank you.
 
I

ibotirama

Guest
The Hibernate has a column named version to control a version of the record, can you try to write in your 'static mapping' a property 'version false' like this :


static mapping = {
datasource 'LOOKUP'
table 'LEGACYTABLE'
version false
columns {
field column: 'LEGACYFIELD'
}
}
 
Top