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

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

The patch will generate the correct SQL for the type expression:
JPQL: SELECT p FROM Person p where TYPE(p) <> Contractor

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

(2) SELECT t0.OID, t1.OID, t1.name, t2.description, t0.Dept_No, t0.PTEmpProp1 
FROM WParttimeEmployee t0 
  INNER JOIN WEmployee t2 ON t0.OID = t2.OID 
  INNER JOIN WPerson t1 ON t2.OID = t1.OID WHERE (1=1)

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

(1) 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 WHERE (1=1)


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

Reply via email to