[ 
https://issues.apache.org/jira/browse/JDO-843?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Bouschen resolved JDO-843.
----------------------------------
    Fix Version/s: JDO 3.2.2
       Resolution: Fixed

Version 5.2.11 of datanucleus-api-jdo fixes the problem.

> JDOQLTypedQuery: issue with candidate("this") method
> ----------------------------------------------------
>
>                 Key: JDO-843
>                 URL: https://issues.apache.org/jira/browse/JDO-843
>             Project: JDO
>          Issue Type: Bug
>          Components: tck
>    Affects Versions: JDO 3.2.1
>            Reporter: Michael Bouschen
>            Assignee: Michael Bouschen
>            Priority: Major
>             Fix For: JDO 3.2.2
>
>
> TCK Class {color:#000000}SampleReadQueries implements the sample queries from 
> the JDO specification chapter 14.11.{color}
> {color:#000000}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 
>   {color}{color:#000000}QFullTimeEmployee.candidate() by 
>   QFullTimeEmployee.candidate("this")
> The expected query result consist of three 
> {color}{color:#000000}FullTimeEmployee instances wrapped into a EmpWrapper 
> instance (testQuery15f) or {color}EmpInfo instance 
> ({color:#000000}testQuery16f{color}). Instead the 
> {color:#000000}FullTimeEmployee instance is null that gets wrappe into a 
> EmpWrapper/EmpInfo.{color}
> {color:#000000}The generated SQL does not differ depending on which candidate 
> method is used.{color}
> {color:#000000}Junit Test results when running the test Methods with 
> QFullTimeEmployee.candidate("this"):{color}
> {color:#000000}{{{{{}  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)]{color}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to