You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Maxim Solodovnik (Jira)" <ji...@apache.org> on 2026/09/16 03:50:00 UTC
[jira] [Resolved] (OPENJPA-2961) TREAT discriminator filter excludes subclasses of target
[ https://issues.apache.org/jira/browse/OPENJPA-2961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maxim Solodovnik resolved OPENJPA-2961.
---------------------------------------
Assignee: Richard Zowalla
Resolution: Fixed
> 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)