You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Michael Watzek (JIRA)" <ji...@apache.org> on 2005/10/05 16:00:11 UTC

[jira] Created: (JDO-169) JPOX generates wrong SQL statements navigating relationships in JDO queries

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


[jira] Resolved: (JDO-169) JPOX generates wrong SQL statements navigating relationships in JDO queries

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-169?page=all ]
     
Andy Jefferson resolved JDO-169:
--------------------------------

    Resolution: Fixed
     Assign To: Andy Jefferson  (was: Erik Bengtson)

Fixed in JPOX CVS.

> 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: Bug
>   Components: tck20
>     Reporter: Michael Watzek
>     Assignee: Andy Jefferson

>
> 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


[jira] Updated: (JDO-169) JPOX generates wrong SQL statements navigating relationships in JDO queries

Posted by "Michael Watzek (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-169?page=all ]

Michael Watzek updated JDO-169:
-------------------------------

    type: Bug  (was: Improvement)

> 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: Bug
>   Components: tck20
>     Reporter: Michael Watzek
>     Assignee: 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