cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor Antonovich (JIRA)" <j...@apache.org>
Subject [jira] Created: (CAY-1481) EQBQL query against of single-table mapped inherited objects is transformed to incorrect SQL query
Date Tue, 07 Sep 2010 09:10:32 GMT
EQBQL query against of single-table mapped inherited objects is transformed to incorrect  SQL
query
---------------------------------------------------------------------------------------------------

                 Key: CAY-1481
                 URL: https://issues.apache.org/jira/browse/CAY-1481
             Project: Cayenne
          Issue Type: Bug
          Components: Core Library
    Affects Versions: 3.1M1
            Reporter: Victor Antonovich


Type qualifier part of SQL query generated from EJBQL query for inherited objects is not correctly
embraced. For example, EJBQL query against class Group inherited from class User where both
mapped to Roles table:

SELECT DISTINCT g FROM Group g WHERE g.id IS NULL

is transformed to SQL query:

SELECT DISTINCT t0.id AS ec0_0, t0.name AS ec0_1, t0.type AS ec0_2 FROM ROLES t0 WHERE t0.type
= ? OR t0.type = ? AND t0.id IS NULL [bind: 1:1, 2:2]

which is wrong because type qualifier part must be embraced:

SELECT DISTINCT t0.id AS ec0_0, t0.name AS ec0_1, t0.type AS ec0_2 FROM ROLES t0 WHERE ( t0.type
= ? OR t0.type = ? ) AND t0.id IS NULL [bind: 1:1, 2:2]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message