You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Mark Struberg (Jira)" <ji...@apache.org> on 2020/02/14 20:12:00 UTC
[jira] [Updated] (OPENJPA-2694) Creating count(distinct x.field)
fails when using CriteriaBuilder
[ 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.1)
3.1.2
> 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, 3.1.2
>
>
> 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
(v8.3.4#803005)