问题
I had in the old Config.groovy:
grails.gorm.default.mapping = {
id generator = 'identity'
// send only the dirty fields to the database for updating
dynamicUpdate = true
dynamicInsert = true
}
So I put this in the additionally application.groovy, but it won't be respected any more. All updates are full, sending all fields to the database, even the not changed ones.
I tried to translate this in application.yml:
grails:
gorm:
default:
mapping:
id generator: "identity"
dynamicUpdate: true
dynamicInsert: true
... but still without luck.
回答1:
With Grails 3.1.10, it works in application.groovy:
dataSource {
//....
}
grails.gorm.default.mapping = {
uuid index:'idx_uuid', type: org.hibernate.type.UUIDCharType, length: 36, defaultValue: null
batchSize 15000
}
but had no sucess either while putting it in application.yml
来源:https://stackoverflow.com/questions/29516108/grails-3-0-1-how-and-where-to-configure-grails-gorm-default-mapping