Maxim Solodovnik created OPENJPA-2961:
-----------------------------------------
Summary: 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
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)