We're updating the issue view to help you get more done. 

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

Environment

hsqldb 2.3.0

Status

Assignee

Lukasz Antoniak

Reporter

Piotr Ostrowski

Labels

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Fix versions

Affects versions

4.3.0.Beta5
4.2.7.SP1

Priority

Minor