oracle-databasegrailsgrails-ormvirtual-column

Save entities with virtual columns in gorm grails


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


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
    }