[jira] [Updated] (OPENJPA-2694) Creating count(distinct x.field) fails when using CriteriaBuilder

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OPENJPA-2694) Creating count(distinct x.field) fails when using CriteriaBuilder

JIRA jira@apache.org

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

Mark Struberg updated OPENJPA-2694:
-----------------------------------
    Description:
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}

  was:
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}


> 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
> {code}
> criteriaBuilder.countDistinct(path.get(attribute));
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)