Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
JDO 3.2.1
-
None
-
None
Description
TCK Class SampleReadQueries implements the sample queries from the JDO specification chapter 14.11.
Methods testQuery15f and testQuery16f implement the typesafe query version. The code uses QFullTimeEmployee.candidate() to access instances of the candidate class. The query returns a wrong query result, When replacing the call
QFullTimeEmployee.candidate() by
QFullTimeEmployee.candidate("this")
The expected query result consist of three FullTimeEmployee instances wrapped into a EmpWrapper instance (testQuery15f) or EmpInfo instance (testQuery16f). Instead the FullTimeEmployee instance is null that gets wrappe into a EmpWrapper/EmpInfo.
The generated SQL does not differ depending on which candidate method is used.
Junit Test results when running the test Methods with QFullTimeEmployee.candidate("this"):
{{ JUnit Jupiter:JDO843Test:testQuery15f()}}
{{ MethodSource [className = 'org.apache.jdo.tck.query.api.JDO843Test', methodName = 'testQuery15f', methodParameterTypes = '']}}
{{ => org.opentest4j.AssertionFailedError: Assertion (SampleQueries) failed: }}
{{Wrong query result: }}
{{query: select into org.apache.jdo.tck.query.api.SampleReadQueries$EmpWrapper from org.apache.jdo.tck.pc.company.FullTimeEmployee where salary > :sal}}
{{expected: java.util.ArrayList of size 3}}
[EmpWrapper(FullTimeEmployee:name = Michael), EmpWrapper(FullTimeEmployee:name = Craig), EmpWrapper(FullTimeEmployee:name = Tillmann)]
{{got: java.util.ArrayList of size 3}}
[EmpWrapper(FullTimeEmployee:null), EmpWrapper(FullTimeEmployee:null), EmpWrapper(FullTimeEmployee:null)]
{{ JUnit Jupiter:JDO843Test:testQuery16f()}}
{{ MethodSource [className = 'org.apache.jdo.tck.query.api.JDO843Test', methodName = 'testQuery16f', methodParameterTypes = '']}}
{{ => org.opentest4j.AssertionFailedError: Assertion (SampleQueries) failed: }}
{{Wrong query result: }}
{{query: select into org.apache.jdo.tck.query.api.SampleReadQueries$EmpInfo from org.apache.jdo.tck.pc.company.FullTimeEmployee where salary > :sal}}
{{expected: java.util.ArrayList of size 3}}
[EmpInfo(worker:Michael), EmpInfo(worker:Craig), EmpInfo(worker:Tillmann)]
{{got: java.util.ArrayList of size 3}}
[EmpInfo(worker:null), EmpInfo(worker:null), EmpInfo(worker:null)]