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(
52125212
52135213 private Predicate createTreatTypeRestriction (SqmPath <?> lhs , EntityDomainType <?> treatTarget ) {
52145214 final AbstractEntityPersister entityDescriptor = (AbstractEntityPersister ) domainModel .findEntityDescriptor ( treatTarget .getHibernateEntityName () );
5215- if ( entityDescriptor .isPolymorphic () ) {
5215+ if ( entityDescriptor .isPolymorphic () && lhs . getNodeType () != treatTarget ) {
52165216 final Set <String > subclassEntityNames = entityDescriptor .getSubclassEntityNames ();
52175217 return createTreatTypeRestriction ( lhs , subclassEntityNames );
52185218 }
You can’t perform that action at this time.
0 commit comments