Grails 3.0.1 - 如何以及在哪里配置grails.gorm.default.mapping [英] Grails 3.0.1 - how and where to configure grails.gorm.default.mapping
本文介绍了Grails 3.0.1 - 如何以及在哪里配置grails.gorm.default.mapping的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在旧的Config.groovy中:
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
}
所以我把它放在了另外的application.groovy中,但它不再受到尊重。所有更新都已满,将所有字段发送到数据库,甚至没有更改。
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.
我试图在application.yml中翻译这个:
I tried to translate this in application.yml:
grails:
gorm:
default:
mapping:
id generator: "identity"
dynamicUpdate: true
dynamicInsert: true
...但仍然没有运气。 p>
... but still without luck.
推荐答案
使用Grails 3.1.10,它可以在application.groovy中工作:
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
}
但在将它放入application.yml中时没有成功
but had no sucess either while putting it in application.yml
这篇关于Grails 3.0.1 - 如何以及在哪里配置grails.gorm.default.mapping的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文