Persist Joda-time’s DateTime via Hibernate

For Hibernate 3 add the following annotation to your date field:

@Type(type="org.joda.time.contrib.hibernate.PersistentDateTime")

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:

@Type(type="org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")

(Make sure you have jadira-usertype-core.jar in your classpath)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)