Uploaded image for project: 'Hibernate ORM'
  1. HHH-8699

Criteria API multiselect not working with Predicates

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      There is a problem with CriteriaQuery.multiselect(...) method. This method takes a list of Selection's as argument.

      When list of Selection's is a list of Path's, everythink works as expected:
      cq.multiselect(r.get("col1"), r.get("col2"), r.get("col3"));

      The problem occurs when to list of Selection's I added some Predicate's. For example:
      cq.multiselect(r.get("col1"), r.get("col2"), r.get("col3"), cb.isNotNull(r.get("col4"));

      This code throws an "org.hibernate.hql.internal.ast.QuerySyntaxException: Unable to locate appropriate constructor" exception, but correct constructor exists. The same code works correctly with OpenJPA, ObjectDB and BatooJPA.

      I have prepared a simple test project for Hibernate and other JPA implementations (attachment). To execute Hibernate test, call:
      mvn clean test -Phibernate

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: