openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fay Wang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1740) Type expression for entites using Joined table strategy is not working properly
Date Wed, 21 Jul 2010 21:26:49 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890907#action_12890907
] 

Fay Wang commented on OPENJPA-1740:
-----------------------------------

In a data model, where Employee inherits from Person. and Contractor/FulltimeEmployee/ParttimeEmployee
inherit from Employee using Joined table strategy, the following JPQL generates wrong sqls:

                                                                              
JPQL: SELECT p FROM Person p where TYPE(p) = Contractor

Push-down SQL:
(1) SELECT t0.OID, t1.OID, t2.OID, t3.OID, t1.name 
FROM WContractor t0 
    LEFT OUTER JOIN WEmployee t2 ON t0.OID = t2.OID 
    LEFT OUTER JOIN WPerson t1 ON t2.OID = t1.OID 
    LEFT OUTER JOIN WFulltimeEmployee t3 ON t2.OID = t3.OID 
    WHERE t2.OID IS NULL AND t0.OID IS NULL AND t3.OID IS NULL

(2) SELECT t0.OID, t2.OID, t1.OID, t3.OID, t2.name, t1.description 
FROM WContractor t0 
    LEFT OUTER JOIN WEmployee t1 ON t0.OID = t1.OID 
    INNER JOIN WPerson t2 ON t1.OID = t2.OID 
    LEFT OUTER JOIN WFulltimeEmployee t3 ON t1.OID = t3.OID 
    WHERE t0.OID IS NULL AND t3.OID IS NULL

(3) SELECT t0.OID, t1.OID, t1.name, t2.description, t0.ContractorProp1, t0.Dept_No 
FROM WContractor t0 
    INNER JOIN WEmployee t2 ON t0.OID = t2.OID 
    INNER JOIN WPerson t1 ON t2.OID = t1.OID

(4) SELECT t0.OID, t1.OID, t2.OID, t1.name, t3.description, t2.Dept_No, t2.FTEmpProp1 
FROM WPerson t1 
    INNER JOIN WEmployee t3 ON t1.OID = t3.OID 
    INNER JOIN WFulltimeEmployee t2 ON t3.OID = t2.OID, 
    WContractor t0

> Type expression for entites using Joined table strategy is not working properly
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc, kernel
>    Affects Versions: 2.1.0
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 2.1.0
>
>


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