Treat on joined inheritance with identical property names results in wrong query

Description

In the attached testcase, RefEntity references the BaseType of a JOINED inheritance. Both SubType1 and SubType2 contain a property named myvalue. When creating a treated join from RefEntity to SubType1 or SubType2, and restricting myvalue, the restriction is always on SubType2.myvalue. For both queries, the JPAQL is:

The treat is lost during rendering from criteria to JPAQL and Hibernate simply picks the first (or last) subtype with a property named myvalue.

A workaround for this problem is to name the properties differently.

Attachments

1

Activity

Details

Assignee

Reporter

Components

Affects versions

Priority

Created May 20, 2016 at 12:18 PM
Updated October 10, 2017 at 5:24 AM