Hello,
This is getting really frustrating sorry but we're close before delivering our app to our customer and went against a show-stopper again. We're building a simple query with the criteria api. What we have is something like (pseudo code)
class TestEntity { public Integer getAge() { return 100; } }; Create Selection Query (Critera-API) from * TestEntity and add WHERE class with CriteraBuilder.function("$1.getAge", Integer.class) ($1 is a valid path we've goot from our root selector). NOTE: Doing "$1.getAge()" does produce the same error
When trying to create a query from the criteria we get this:
11:20:06,538 ERROR .. Servlet.service() for servlet .. threw exception: java.lang.ArrayIndexOutOfBoundsException: 0 at com.objectdb.jpa.criteria.JpqlWriter.writeList(JpqlWriter.java:110) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.JpqlWriter.writeFunction(JpqlWriter.java:130) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.Expressions$c.writeJpql(Expressions.java:262) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.JpqlWriter.write(JpqlWriter.java:94) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.Expressions$b.writeJpql(Expressions.java:211) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.JpqlWriter.write(JpqlWriter.java:90) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.Expressions$k.writeJpql(Expressions.java:734) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.JpqlWriter.write(JpqlWriter.java:94) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.Expressions$k.writeJpql(Expressions.java:730) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.JpqlWriter.write(JpqlWriter.java:94) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.AbstractQueryImpl.writeJpql(AbstractQueryImpl.java:351) [objectdb-2.4.4.jar:] at com.objectdb.jpa.criteria.CriteriaQueryImpl.writeJpql(CriteriaQueryImpl.java:274) [objectdb-2.4.4.jar:] at com.objectdb.jpa.EMImpl.createQuery(EMImpl.java:897) [objectdb-2.4.4.jar:]
Doing exactly the same on a map property with an argument works without troubles!??