Description
The following code leads to a ClassCastException:
final TypedQuery<LocalDate> maxLocalDateQry = em.createQuery("select max(t.localDateField) from Java8TimeTypes AS t", LocalDate.class); final LocalDate maxLocalDate = maxLocalDateQry.getSingleResult(); assertEquals(VAL_LOCAL_DATE, maxLocalDate);
Caused by: java.lang.ClassCastException: Cannot convert object "01.01.19 00:00" of type "class java.sql.Date" into an instance of "class java.time.LocalDate". at org.apache.openjpa.kernel.Filters.convert(Filters.java:336) at org.apache.openjpa.kernel.Filters.convert(Filters.java:264) at org.apache.openjpa.jdbc.kernel.exps.UnaryOp.load(UnaryOp.java:142)