Reputation: 1
I tried without succes to make a custom type mapping between DateTime joda and DATE db2. Which annotations should we use in the case of using joda time hibernate library instead of custom type mapping ? Thanks a lot
Upvotes: 0
Views: 1148
Reputation: 11
Please take a look at my project on Sourceforge (Usertype) which supports Joda Time and the JSR 310 drafts. Unlike the Joda Time Contrib library this works with Hibernate 3.6 and it should be very straightforward to use if you are familiar with Joda Time Contrib's Hibernate usertypes.
See http://usertype.sourceforge.net/
Upvotes: 1
Reputation: 41137
There is an open-source library supporting this on sourceforge. Now that I reread your question, you're likely already using it.
This includes a UserType so that you can map Joda DateTime fields with
@Type(type="org.joda.time.contrib.hibernate.PersistentDateTime")
Upvotes: 2
Reputation: 298978
Why don't you just map plain java dates and convert to / from joda dates when you read / write the values?
Upvotes: 2