[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[eclipselink-users] [JPA Criteria Api] CriteriaBuilder coalesce java.lang.ClassCastException
|
Hello.
When using the method coalesce with an Expression and a literal such as:
criteriaBuilder.coalesce(root.get(attribute),0d)
throws an exception:
Caused by: java.lang.ClassCastException: java.lang.Double cannot be cast to
org.eclipse.persistence.internal.jpa.querydef.InternalSelection
at
org.eclipse.persistence.internal.jpa.querydef.CriteriaBuilderImpl.coalesce(CriteriaBuilderImpl.java:2117)
As a workaround I use:
criteriaBuilder.coalesce(root.get(attribute),criteriaBuilder.literal(0d))
From my understanding I think that the api supports coalesce with java
objects directly. Am I wrong?
Regards
--
Marc Nuri
--
View this message in context: http://old.nabble.com/-JPA-Criteria-Api--CriteriaBuilder-coalesce-java.lang.ClassCastException-tp31163588p31163588.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.