Positional parameters in JPQL queries are not supported.
will return an empty list, but
will return the desired result (given some Customer objects in the DB).
A fully working example to reproduce the issue can be found in https://github.com/dadrus/jpa-unit/blob/master/integration-test/base/src/main/java/eu/drus/jpa/unit/test/AbstractInitialDataSetsTest.java (test4() method line 80). Just replace the query in line 82 one time by
and one time by
and run the tests to see the effects.
With Hibernate OGM and MongoDB it can be run using https://github.com/dadrus/jpa-unit/blob/master/integration-test/jpa-mongodb-hibernate-ogm-test/src/test/java/eu/drus/jpa/unit/test/InitialDataSetsTest.java.
If you run the same tests but for a RDBMS (e.g. from https://github.com/dadrus/jpa-unit/blob/master/integration-test/jpa2.1-hibernate-test/src/test/java/eu/drus/jpa/unit/test/InitialDataSetsTest.java) everything is fine, both cases work as expected.
This limitation makes a usage of libraries like Deltaspike Data, which e.g. generate JPQL queries based on method signatures of a DAO/Repository definitions impossible without workarounds.