cache
目的 Purpose
Enables the Hibernate second-level cache for the domain class.使用例 Examples
class Book {
…
static mapping = {
cache true
}
}詳細 Description
Usage:
使用方法: cache(boolean/string/map)Usage:
cache(boolean/string/map)引数: Arguments:
usage- The cache usage. Can beread-only,read-write,nonstrict-read-writeortransactionalinclude(optional) - Whether to include non-lazy associations. Can beallornon-lazy
static mapping = { cache true }
static mapping = {
cache 'transactional'
}static mapping = {
cache usage: 'read-only', include: 'non-lazy'
}class Author { static hasMany = [books: Book] static mapping = {
books cache: true // or 'read-write' etc.
}
}
