CriteriaQuery fails with
org.hibernate.PropertyNotFoundException: no appropriate constructor in class
when use nullLiteral in query. So if we have constructor like:
public TestForm(String a, String b, String d) { this.a = a; this.b = b; this.d = d; }
The query like:
... 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