我知道這是可以通過的版本設置爲false完全停用版本:休眠:停用列版本更新一個專用的保存
class Book {
…
static mapping = {
version false
}
}
但有可能停用它僅適用於特定的情況下?
域
class Book {
String author
}
當前行爲
def BookInstance = Book.get(1)
println "version $BookInstance.version" //version 1
BookInstance.author = 'John'
BookInstance.save(flush:true)
println "version $BookInstance.version" //version 2
具體情況
def BookInstance = Book.get(1)
println "version $BookInstance.version" //version 1
//Do something to deactivate the update version
BookInstance.author = 'John'
BookInstance.save(flush:true)
println "version $BookInstance.version" //version 1