对于Hibernate 3,在日期字段中添加以下注释:
@Type(type="org.joda.time.contrib.hibernate.PersistentDateTime")
Hibernate现在将为您完成肮脏的工作。
(确保您的类路径中有joda-time-hibernate.jar)
更新:
对于Hibernate 4和5,添加以下注释:
@Type(type="org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")
(确保您的类路径中有jadira-usertype-
core.jar)



