Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2694

Creating count(distinct x.field) fails when using CriteriaBuilder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.2, 3.0.0
    • 3.2.3
    • criteria
    • None

    Description

      when using CriteriaBuilder#countDistinct(path.get(attribute));
      we end up with the following Exception in OpenJPA:

      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.

      The code to reproduce this is

      criteriaBuilder.countDistinct(path.get(attribute));
      

      Attachments

        Activity

          People

            struberg Mark Struberg
            struberg Mark Struberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: