HHH-15917 Unrelated Entity Join throws IllegalStateException

This commit is contained in:
Andrea Boriero 2023-07-19 12:22:27 +02:00 committed by Andrea Boriero
parent 71ee7fbd3c
commit 7c5451d756

View File

@ -14,6 +14,7 @@
import java.util.function.Function;
import org.hibernate.jpa.spi.JpaCompliance;
import org.hibernate.metamodel.model.domain.BasicDomainType;
import org.hibernate.query.hql.HqlLogging;
import org.hibernate.query.hql.spi.SqmCreationProcessingState;
import org.hibernate.query.hql.spi.SqmPathRegistry;
@ -247,7 +248,8 @@ else if ( parentRegistered instanceof SqmEntityJoin<?> ) {
}
private boolean definesAttribute(SqmPathSource<?> containerType, String name) {
return containerType.findSubPathSource( name ) != null;
return !( containerType.getSqmPathType() instanceof BasicDomainType )
&& containerType.findSubPathSource( name ) != null;
}
@Override