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.
Since jodatime is included in the Play distribution, I’m thinking there’s probably a better way to do this. Is there any way I can make my Model fields DateTimes instead of java.util.Date and java.sql.Time so the conversion is done automatically? Is there another way of streamlining this?
For Hibernate 3 add the following annotation to your date field:
Hibernate will now do the dirty work for you.
(Make sure you have joda-time-hibernate.jar in your classpath)
UPDATE:
For Hibernate 4 and 5 add the following annotation:
(Make sure you have jadira-usertype-core.jar in your classpath)