JPOX generates wrong SQL statements navigating relationships in JDO queries
---------------------------------------------------------------------------

         Key: JDO-169
         URL: http://issues.apache.org/jira/browse/JDO-169
     Project: JDO
        Type: Improvement
  Components: tck20  
    Reporter: Michael Watzek
 Assigned to: Erik Bengtson 


This bug shows up in (at least) two test cases: 
NavigationThroughANullValuedField and 
NavigationThroughReferencesUsesDotOperator.

Both test cases run the following JDO query: SELECT FROM Employee WHERE 
medicalInsurance.carrier == \"Carrier1\".

JPOX generates the following SQL:

SELECT 
THIS.DISCRIMINATOR,THIS.BIRTHDATE,THIS.FIRSTNAME,THIS.LASTNAME,THIS.PERSONID,THIS.HIREDATE,THIS.WEEKLYHOURS
 FROM applicationidentity0.PERSONS THIS LEFT OUTER JOIN 
applicationidentity0.INSURANCEPLANS RELATED14 ON RELATED14.EMPLOYEE = 
THIS.PERSONID WHERE (THIS.DISCRIMINATOR = 
'org.apache.jdo.tck.pc.company.Employee' OR THIS.DISCRIMINATOR = 
'org.apache.jdo.tck.pc.company.PartTimeEmployee' OR THIS.DISCRIMINATOR = 
'org.apache.jdo.tck.pc.company.FullTimeEmployee') AND RELATED14.CARRIER = 
'Carrier1'

The WHERE clause of this SQL statement misses a discriminator comparison for 
the navigated relationship: 

AND RELATED14.DISCRIMINATOR = 'org.apache.jdo.tck.pc.company.MedicalInsurance'

Once, the patch of JDO-168 has been checked in the test cases mentioned above 
fail due to this reason.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to