File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed
hibernate-core/src/main/java/org/hibernate/query/sqm/sql Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -5212,7 +5212,7 @@ private Set<String> determineEntityNamesForTreatTypeRestriction(
5212
5212
5213
5213
private Predicate createTreatTypeRestriction (SqmPath <?> lhs , EntityDomainType <?> treatTarget ) {
5214
5214
final AbstractEntityPersister entityDescriptor = (AbstractEntityPersister ) domainModel .findEntityDescriptor ( treatTarget .getHibernateEntityName () );
5215
- if ( entityDescriptor .isPolymorphic () ) {
5215
+ if ( entityDescriptor .isPolymorphic () && lhs . getNodeType () != treatTarget ) {
5216
5216
final Set <String > subclassEntityNames = entityDescriptor .getSubclassEntityNames ();
5217
5217
return createTreatTypeRestriction ( lhs , subclassEntityNames );
5218
5218
}
You can’t perform that action at this time.
0 commit comments