简体   繁体   English

Grails 3.0.1 - 如何以及在何处配置grails.gorm.default.mapping

[英]Grails 3.0.1 - how and where to configure grails.gorm.default.mapping

I had in the old Config.groovy: 我在旧的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. 所以我把它放在另外的application.groovy中,但它不会再被尊重了。 All updates are full, sending all fields to the database, even the not changed ones. 所有更新都已满,将所有字段发送到数据库,甚至是未更改的字段。

I tried to translate this in application.yml: 我试着在application.yml中翻译它:

grails:
    gorm:
        default:
            mapping:
                id generator:  "identity"
                dynamicUpdate: true
                dynamicInsert: true

... but still without luck. ......但仍然没有运气。

With Grails 3.1.10, it works in application.groovy: 使用Grails 3.1.10,它适用于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 但是在将它放入application.yml时没有成功

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM