【问题标题】:Grails 3.0.9 JodaTime format YMLGrails 3.0.9 JodaTime 格式 YML
【发布时间】:2016-02-29 06:51:30
【问题描述】:

我想在数据库中使用常规时间表示。

在 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 格式编写。 请帮帮我

【问题讨论】:

    标签: grails grails-orm yaml grails-plugin


    【解决方案1】:

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

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

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-01
    • 1970-01-01
    • 2014-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-22
    • 2016-03-16
    相关资源
    最近更新 更多