Question

So , in my application i have a entity with a virtual column. The column takes values depending on what i save in another column.

On save i have the following error:

java.sql.BatchUpdateException: ORA-54013: INSERT operation disallowed on virtual columns

This is because i am sending a null value on that field.

Does anybody know how to map a virtual column in gorm?

Thanks

Était-ce utile?

La solution

The extended GORM mappings plugins allows you to mark individual columns to be excluded from inserts and updates.

Example:

static mapping = {
    readOnlyColumn updateable: false, insertable: false
}

Autres conseils

Grails derived properties might provide the functionality you need.

http://grails.org/doc/latest/guide/GORM.html#derivedProperties

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top