Criteria API multiselect not working with Predicates

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

1

Activity

Show:

Brett Meyer January 8, 2014 at 11:02 PM

Thanks to for the fix!

Fixed

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Created November 13, 2013 at 4:52 PM
Updated May 5, 2022 at 10:49 AM
Resolved May 5, 2022 at 10:49 AM