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)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…