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

JPA Constructor Expressions fails with nullLiteral passed to constructor

Description

CriteriaQuery fails with

1 org.hibernate.PropertyNotFoundException: no appropriate constructor in class

when use nullLiteral in query.
So if we have constructor like:

1 2 3 4 5 public TestForm(String a, String b, String d) { this.a = a; this.b = b; this.d = d; }

The query like:

1 2 3 4 5 ... CriteriaQuery<TestForm> c = cb.createQuery(TestForm.class); Root<TestEntity> r = c.from(TestEntity.class); c.multiselect(r.get("name"), cb.nullLiteral(String.class), r.get("name")); ....

Will fail with no appropriate constructor in class exception.
Test case attached

Environment

None

Status

Assignee

Andrea Boriero

Reporter

Nikita Metzger

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.2.0
5.1.0
5.0.9

Priority

Major