SINGLE_TABLE associated entity query missing restriction of DiscriminatorColumn

Description

Sorry for my poor English.
There are 3 objects: PostTable, Post and Category.
Post and Category both extends PostTable . PostTable represents the data table named "cp_table". The "type" field is the DiscriminatorColumn of table, data type is integer.
The Category entity's DiscriminatorValue is "1", the Post's is "2".
The code outlines of them as below:

However, when I invoke Category Entity's getChildren() method to gain the associated Collection of Category, I found that the collection contains the Post entity ( which's type = "2") unexpectedly !

The java code as blow:

The corresponding SQL statement as blow:
"
SELECT
children0_.category_id AS categor17_38_1_,
children0_.id AS id2_38_1_,
children0_.id AS id2_38_0_,
children0_.add_time AS add_time3_38_0_,
children0_.alias AS alias4_38_0_,
children0_.author AS author5_38_0_,
children0_.content AS content6_38_0_,
children0_.hits AS hits7_38_0_,
children0_.image AS image8_38_0_,
children0_.keyword AS keyword9_38_0_,
children0_.post_order AS post_or10_38_0_,
children0_.source AS source11_38_0_,
children0_. STATUS AS status12_38_0_,
children0_.summary AS summary13_38_0_,
children0_.title AS title14_38_0_,
children0_.update_time AS update_15_38_0_,
children0_.user_id AS user_id16_38_0_,
children0_.category_id AS categor17_38_0_
FROM
cp_post children0_
WHERE
children0_.category_id =?
ORDER BY
children0_.post_order ASC
"

However, the expected query should add type restriction. e.g. " AND children0_.type = 1" .
Because the definition of Category entity is "type = 1", it should be treated strictly in anywhere.

Additionally. the Hibernate version I'm using is 5.2.6 Final. I've no enough time to test for each version.
Best wishes.

Environment

Java 1.8.0_91
MySQL 5.7.16
Tomcat 8.0.39

Status

Assignee

Unassigned

Reporter

Ready

Fix versions

Labels

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Blocker
Configure