Persist Joda-time's DateTime via Hibernate

后端 未结 4 1271
没有蜡笔的小新
没有蜡笔的小新 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 19:01

    Instead of putting the @Type annotation at each of your Joda properties you can add this in your jpa properties

    #Hibernate config
    jadira.usertype.autoRegisterUserTypes=true
    

    and it should work just fine.

    ps. jadira-usertype-core.jar should be in your classpath.

提交回复
热议问题