HHH-18321 Avoid search for table group when possible for paths
This commit is contained in:
parent
5ca841c184
commit
0c48c12f99
|
@ -45,6 +45,7 @@ import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||||
import org.hibernate.metamodel.mapping.MappingModelExpressible;
|
import org.hibernate.metamodel.mapping.MappingModelExpressible;
|
||||||
import org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess;
|
import org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess;
|
||||||
import org.hibernate.metamodel.model.domain.BasicDomainType;
|
import org.hibernate.metamodel.model.domain.BasicDomainType;
|
||||||
|
import org.hibernate.metamodel.model.domain.DomainType;
|
||||||
import org.hibernate.metamodel.model.domain.EmbeddableDomainType;
|
import org.hibernate.metamodel.model.domain.EmbeddableDomainType;
|
||||||
import org.hibernate.metamodel.model.domain.EntityDomainType;
|
import org.hibernate.metamodel.model.domain.EntityDomainType;
|
||||||
import org.hibernate.metamodel.model.domain.JpaMetamodel;
|
import org.hibernate.metamodel.model.domain.JpaMetamodel;
|
||||||
|
@ -721,6 +722,10 @@ public class MappingMetamodelImpl extends QueryParameterBindingTypeResolverImpl
|
||||||
SqmExpressible<?> sqmExpressible,
|
SqmExpressible<?> sqmExpressible,
|
||||||
Function<NavigablePath, TableGroup> tableGroupLocator) {
|
Function<NavigablePath, TableGroup> tableGroupLocator) {
|
||||||
if ( sqmExpressible instanceof SqmPath<?> sqmPath ) {
|
if ( sqmExpressible instanceof SqmPath<?> sqmPath ) {
|
||||||
|
final DomainType<?> sqmPathType = sqmPath.getResolvedModel().getSqmPathType();
|
||||||
|
if ( sqmPathType instanceof MappingModelExpressible<?> mappingExpressible ) {
|
||||||
|
return mappingExpressible;
|
||||||
|
}
|
||||||
final NavigablePath navigablePath = sqmPath.getNavigablePath();
|
final NavigablePath navigablePath = sqmPath.getNavigablePath();
|
||||||
if ( navigablePath.getParent() != null ) {
|
if ( navigablePath.getParent() != null ) {
|
||||||
final TableGroup parentTableGroup = tableGroupLocator.apply( navigablePath.getParent() );
|
final TableGroup parentTableGroup = tableGroupLocator.apply( navigablePath.getParent() );
|
||||||
|
|
Loading…
Reference in New Issue