(Quick Reference)

version

目的
Purpose

Used to disable optimistic locking or change the column that holds the version.

使用例
Examples

class Book {
    …
    static mapping = {
        version false
    }
}

詳細
Description

Usage: version(string/boolean)
使用方法:
Usage:
version(string/boolean)

By default GORM is configured with optimistic locking enabled. You can disable this by calling the version method with an argument of false:

static mapping = {
    version false
}

You can pass the name to the version method to change the name of the database column:

static mapping = {
    version 'revision_number'
}