[ 
https://issues.apache.org/jira/browse/OPENJPA-2694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark Struberg updated OPENJPA-2694:
-----------------------------------
    Fix Version/s:     (was: 3.1.0)

> 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
>            Priority: Major
>             Fix For: 2.4.4
>
>
> 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 
> {code}
> criteriaBuilder.countDistinct(path.get(attribute));
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to