Mark Struberg created OPENJPA-2694:
--------------------------------------
Summary: Creating count(distinct x.field) fails when using
CriteriaBuilder
Key: OPENJPA-2694
URL: https://issues.apache.org/jira/browse/OPENJPA-2694
Project: OpenJPA
Issue Type: Bug
Components: criteria
Affects Versions: 2.4.2, 3.0.0
Reporter: Mark Struberg
Assignee: Mark Struberg
Fix For: 2.4.3, 3.0.0
when using CriteriaBuilder#countDistinct(path.get(attribute));
we end up with the following Exception in OpenJPA:
{quote}
org.apache.openjpa.persistence.ArgumentException: Failed to execute query
"null". Check the query syntax for correctness. See nested exception for
details.
at
org.apache.deltaspike.data.impl.criteria.CriteriaTest.should_create_count_criteria(CriteriaTest.java:366)
Caused by: java.lang.Exception: java.lang.RuntimeException: Can not find
constructor for "class java.lang.Long" with argument types "[class
java.lang.Long]" to fill data.
{quote}
The code to reproduce this is
{source}
criteriaBuilder.countDistinct(path.get(attribute));
{source}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)