Persist Joda-time's DateTime via Hibernate

后端 未结 4 1269
没有蜡笔的小新
没有蜡笔的小新 2020-12-13 18:33

I\'m using Jodatime in my Play app, but currently having to do a bunch of converting back and forth from/to java.util.Date and java.sql.Time.

4条回答
  •  轮回少年
    2020-12-13 18:44

    1. Joda recommends to use the UserType libraries with Hibernate 4.0, the version of Hibernate bundled with Play 1.2.x (see: http://joda-time.sourceforge.net/contrib/hibernate/index.html).

    2. The proper way to handle the dependency is using the dependencies.yml file, including a line like this:

      - org.jadira.usertype -> usertype.jodatime 2.0.1
      

提交回复
热议问题