I'd like to use the hibernate criteria api on my Order entity in the following way:
Restrictions.eq("orderDate", new org.joda.time.DateTime());
However my Order entity uses the Java 8 time api:
class Order {
java.time.ZonedDateTime orderDate;
}
With the code as it stands Hibernate tries to cast the joda DateTime to the java ZonedDateTime, which inevitably fails.
I was wondering if anyone knows of a way to inform hibernate how to convert any occurrences of DateTime to ZonedDateTime without having to make a change to the Restrictions.eq call?