2015-11-26 33 views
0

我想在数据库中使用常规时间表示法。Grails 3.0.9 JodaTime格式YML

在Grails的2.x使用

grails.gorm.default.mapping = { 
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentDateTime, class: org.joda.time.DateTime 
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentLocalDate, class: org.joda.time.LocalDate 
} 

我有一个问题是这样写的YML格式。 请帮我

回答

0

根据Issue 9930,Grails 3.0 .yml似乎不支持用户类型。它使用配置DSL创建此GORM条目。我还没有找到使用YML格式的方法。

我只是用application.groovy这一个和其他所有配置(到目前为止)application.yml。有两个文件似乎工作。

不是一个很好的解决方案,但我感觉Grails团队非常喜欢YML方法。我了解到,坚持球队喜欢的东西是很好的:)。

+0

application.groovy中封闭方法的缺点是,杰克逊目前有一个问题。因此访问spring-boot/env执行器会导致Jackson错误。请参阅https://github.com/grails/grails-core/issues/10279 – Bertl