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

ASF subversion and git services commented on OPENJPA-2961:
----------------------------------------------------------

Commit b717116291de48b2e53d2a228c69bf7674e2df9b in openjpa's branch 
refs/heads/OPENJPA-2961 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=b71711629 ]

[OPENJPA-2961] Use try-with-resources for the EntityManager in the TREAT 
subclass test


> TREAT discriminator filter excludes subclasses of target
> --------------------------------------------------------
>
>                 Key: OPENJPA-2961
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2961
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: jpa
>    Affects Versions: 4.2.0
>            Reporter: Maxim Solodovnik
>            Assignee: Richard Zowalla
>            Priority: Major
>             Fix For: 4.2.0
>
>
> Discussion thread: 
> https://github.com/apache/openjpa/pull/144#discussion_r3683001854
> **(medium)** `appendTreatDiscriminator` emits `disc = <treated class value>` 
> only. Per JPA, `TREAT(x AS Middle)` must also match subtypes of Middle, so 
> for a 3-level hierarchy this incorrectly filters out instances of Middle's 
> subclasses - it should be an IN over the discriminator values of the treated 
> class and all mapped subclasses. It also only handles `cols[0]` of the 
> discriminator.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to