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

JPA Constructor Expressions fails with nullLiteral passed to constructor

    Details

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

      Description

      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

        Attachments

          Issue links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: