Search in sources :

Example 1 with SelectableConsumer

use of org.hibernate.metamodel.mapping.SelectableConsumer in project hibernate-orm by hibernate.

the class DynamicFetchBuilderStandard method buildFetch.

@Override
public Fetch buildFetch(FetchParent parent, NavigablePath fetchPath, JdbcValuesMetadata jdbcResultsMetadata, BiFunction<String, String, DynamicFetchBuilderLegacy> legacyFetchResolver, DomainResultCreationState domainResultCreationState) {
    final DomainResultCreationStateImpl creationStateImpl = ResultsHelper.impl(domainResultCreationState);
    final TableGroup ownerTableGroup = creationStateImpl.getFromClauseAccess().getTableGroup(parent.getNavigablePath());
    final Fetchable attributeMapping = (Fetchable) parent.getReferencedMappingContainer().findSubPart(fetchableName, null);
    final SqlExpressionResolver sqlExpressionResolver = domainResultCreationState.getSqlAstCreationState().getSqlExpressionResolver();
    final SelectableConsumer selectableConsumer = (selectionIndex, selectableMapping) -> {
        final TableReference tableReference = ownerTableGroup.resolveTableReference(fetchPath, selectableMapping.getContainingTableExpression());
        final String columnAlias = columnNames.get(selectionIndex);
        sqlExpressionResolver.resolveSqlSelection(sqlExpressionResolver.resolveSqlExpression(createColumnReferenceKey(tableReference, selectableMapping.getSelectionExpression()), state -> {
            final int resultSetPosition = jdbcResultsMetadata.resolveColumnPosition(columnAlias);
            final int valuesArrayPosition = resultSetPosition - 1;
            return new ResultSetMappingSqlSelection(valuesArrayPosition, selectableMapping.getJdbcMapping());
        }), selectableMapping.getJdbcMapping().getMappedJavaType(), domainResultCreationState.getSqlAstCreationState().getCreationContext().getSessionFactory().getTypeConfiguration());
    };
    if (attributeMapping instanceof BasicValuedMapping) {
        attributeMapping.forEachSelectable(selectableConsumer);
        return parent.generateFetchableFetch(attributeMapping, fetchPath, FetchTiming.IMMEDIATE, true, null, creationStateImpl);
    } else if (attributeMapping instanceof EmbeddedAttributeMapping) {
        attributeMapping.forEachSelectable(selectableConsumer);
        return parent.generateFetchableFetch(attributeMapping, fetchPath, FetchTiming.IMMEDIATE, false, null, creationStateImpl);
    } else if (attributeMapping instanceof ToOneAttributeMapping) {
        final ToOneAttributeMapping toOneAttributeMapping = (ToOneAttributeMapping) attributeMapping;
        toOneAttributeMapping.getForeignKeyDescriptor().getPart(toOneAttributeMapping.getSideNature()).forEachSelectable(selectableConsumer);
        return parent.generateFetchableFetch(attributeMapping, fetchPath, FetchTiming.DELAYED, false, null, creationStateImpl);
    } else {
        assert attributeMapping instanceof PluralAttributeMapping;
        final PluralAttributeMapping pluralAttributeMapping = (PluralAttributeMapping) attributeMapping;
        pluralAttributeMapping.getKeyDescriptor().visitTargetSelectables(selectableConsumer);
        return parent.generateFetchableFetch(attributeMapping, fetchPath, FetchTiming.DELAYED, false, null, creationStateImpl);
    }
}
Also used : DomainResultCreationState(org.hibernate.sql.results.graph.DomainResultCreationState) Fetchable(org.hibernate.sql.results.graph.Fetchable) FetchTiming(org.hibernate.engine.FetchTiming) ResultSetMappingSqlSelection(org.hibernate.query.results.ResultSetMappingSqlSelection) BiFunction(java.util.function.BiFunction) NavigablePath(org.hibernate.query.spi.NavigablePath) DomainResultCreationStateImpl(org.hibernate.query.results.DomainResultCreationStateImpl) BasicValuedMapping(org.hibernate.metamodel.mapping.BasicValuedMapping) Fetch(org.hibernate.sql.results.graph.Fetch) ArrayList(java.util.ArrayList) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) TableReference(org.hibernate.sql.ast.tree.from.TableReference) JdbcValuesMetadata(org.hibernate.sql.results.jdbc.spi.JdbcValuesMetadata) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) ResultsHelper(org.hibernate.query.results.ResultsHelper) List(java.util.List) NativeQuery(org.hibernate.query.NativeQuery) ToOneAttributeMapping(org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping) SelectableConsumer(org.hibernate.metamodel.mapping.SelectableConsumer) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) EmbeddedAttributeMapping(org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping) SqlExpressionResolver.createColumnReferenceKey(org.hibernate.sql.ast.spi.SqlExpressionResolver.createColumnReferenceKey) FetchParent(org.hibernate.sql.results.graph.FetchParent) Fetchable(org.hibernate.sql.results.graph.Fetchable) DomainResultCreationStateImpl(org.hibernate.query.results.DomainResultCreationStateImpl) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) SelectableConsumer(org.hibernate.metamodel.mapping.SelectableConsumer) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) ResultSetMappingSqlSelection(org.hibernate.query.results.ResultSetMappingSqlSelection) BasicValuedMapping(org.hibernate.metamodel.mapping.BasicValuedMapping) TableReference(org.hibernate.sql.ast.tree.from.TableReference) EmbeddedAttributeMapping(org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping) ToOneAttributeMapping(org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver)

Example 2 with SelectableConsumer

use of org.hibernate.metamodel.mapping.SelectableConsumer in project hibernate-orm by hibernate.

the class EntityValuedPathInterpretation method from.

public static <T> EntityValuedPathInterpretation<T> from(NavigablePath navigablePath, TableGroup tableGroup, ModelPart resultModelPart, EntityValuedModelPart mapping, EntityValuedModelPart treatedMapping, SqmToSqlAstConverter sqlAstCreationState) {
    final SqlExpressionResolver sqlExprResolver = sqlAstCreationState.getSqlExpressionResolver();
    final SessionFactoryImplementor sessionFactory = sqlAstCreationState.getCreationContext().getSessionFactory();
    final Expression sqlExpression;
    if (resultModelPart == null) {
        final EntityMappingType entityMappingType = mapping.getEntityMappingType();
        final EntityIdentifierMapping identifierMapping = entityMappingType.getIdentifierMapping();
        final EntityDiscriminatorMapping discriminatorMapping = entityMappingType.getDiscriminatorMapping();
        final List<Expression> expressions = new ArrayList<>(entityMappingType.getJdbcTypeCount() + identifierMapping.getJdbcTypeCount() + (discriminatorMapping == null ? 0 : 1));
        final TableGroup parentTableGroup = tableGroup;
        final SelectableConsumer selectableConsumer = (selectionIndex, selectableMapping) -> {
            final TableReference tableReference = parentTableGroup.resolveTableReference(navigablePath, selectableMapping.getContainingTableExpression(), false);
            expressions.add(sqlExprResolver.resolveSqlExpression(createColumnReferenceKey(tableReference, selectableMapping.getSelectionExpression()), processingState -> new ColumnReference(tableReference, selectableMapping, sessionFactory)));
        };
        identifierMapping.forEachSelectable(selectableConsumer);
        if (discriminatorMapping != null) {
            discriminatorMapping.forEachSelectable(selectableConsumer);
        }
        entityMappingType.forEachSelectable(selectableConsumer);
        sqlExpression = new SqlTuple(expressions, entityMappingType);
    } else {
        if (resultModelPart instanceof BasicValuedModelPart) {
            final BasicValuedModelPart basicValuedModelPart = (BasicValuedModelPart) resultModelPart;
            final TableReference tableReference = tableGroup.resolveTableReference(navigablePath, basicValuedModelPart.getContainingTableExpression());
            sqlExpression = sqlExprResolver.resolveSqlExpression(createColumnReferenceKey(tableReference, basicValuedModelPart.getSelectionExpression()), processingState -> new ColumnReference(tableReference, basicValuedModelPart, sessionFactory));
        } else {
            final List<Expression> expressions = new ArrayList<>(resultModelPart.getJdbcTypeCount());
            resultModelPart.forEachSelectable((selectionIndex, selectableMapping) -> {
                final TableReference tableReference = tableGroup.resolveTableReference(navigablePath, selectableMapping.getContainingTableExpression());
                expressions.add(sqlExprResolver.resolveSqlExpression(createColumnReferenceKey(tableReference, selectableMapping.getSelectionExpression()), processingState -> new ColumnReference(tableReference, selectableMapping, sessionFactory)));
            });
            sqlExpression = new SqlTuple(expressions, resultModelPart);
        }
    }
    return new EntityValuedPathInterpretation<>(sqlExpression, navigablePath, tableGroup, treatedMapping);
}
Also used : BasicValuedModelPart(org.hibernate.metamodel.mapping.BasicValuedModelPart) DomainResultCreationState(org.hibernate.sql.results.graph.DomainResultCreationState) SqlTupleContainer(org.hibernate.sql.ast.tree.expression.SqlTupleContainer) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference) EntityValuedModelPart(org.hibernate.metamodel.mapping.EntityValuedModelPart) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) ArrayList(java.util.ArrayList) TableReference(org.hibernate.sql.ast.tree.from.TableReference) ModelPart(org.hibernate.metamodel.mapping.ModelPart) EntityAssociationMapping(org.hibernate.metamodel.mapping.EntityAssociationMapping) ToOneAttributeMapping(org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) Assignable(org.hibernate.sql.ast.tree.update.Assignable) NavigablePath(org.hibernate.query.spi.NavigablePath) SqmEntityValuedSimplePath(org.hibernate.query.sqm.tree.domain.SqmEntityValuedSimplePath) Expression(org.hibernate.sql.ast.tree.expression.Expression) EntityDiscriminatorMapping(org.hibernate.metamodel.mapping.EntityDiscriminatorMapping) SqmToSqlAstConverter(org.hibernate.query.sqm.sql.SqmToSqlAstConverter) SqlAstWalker(org.hibernate.sql.ast.SqlAstWalker) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) Consumer(java.util.function.Consumer) EntityIdentifierMapping(org.hibernate.metamodel.mapping.EntityIdentifierMapping) List(java.util.List) SqlTuple(org.hibernate.sql.ast.tree.expression.SqlTuple) Collections(java.util.Collections) MappingModelExpressible(org.hibernate.metamodel.mapping.MappingModelExpressible) SelectableConsumer(org.hibernate.metamodel.mapping.SelectableConsumer) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) SqlExpressionResolver.createColumnReferenceKey(org.hibernate.sql.ast.spi.SqlExpressionResolver.createColumnReferenceKey) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) BasicValuedModelPart(org.hibernate.metamodel.mapping.BasicValuedModelPart) SelectableConsumer(org.hibernate.metamodel.mapping.SelectableConsumer) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) ArrayList(java.util.ArrayList) EntityDiscriminatorMapping(org.hibernate.metamodel.mapping.EntityDiscriminatorMapping) TableReference(org.hibernate.sql.ast.tree.from.TableReference) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) Expression(org.hibernate.sql.ast.tree.expression.Expression) EntityIdentifierMapping(org.hibernate.metamodel.mapping.EntityIdentifierMapping) SqlTuple(org.hibernate.sql.ast.tree.expression.SqlTuple) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference)

Example 3 with SelectableConsumer

use of org.hibernate.metamodel.mapping.SelectableConsumer in project hibernate-orm by hibernate.

the class CompleteResultBuilderCollectionStandard method resolveSelections.

private void resolveSelections(TableGroup tableGroup, ModelPart modelPart, String[] columnNames, JdbcValuesMetadata jdbcResultsMetadata, DomainResultCreationStateImpl creationStateImpl) {
    final SelectableConsumer consumer = (selectionIndex, selectableMapping) -> {
        final String columnName = columnNames[selectionIndex];
        creationStateImpl.resolveSqlSelection(creationStateImpl.resolveSqlExpression(SqlExpressionResolver.createColumnReferenceKey(tableGroup.resolveTableReference(selectableMapping.getContainingTableExpression()), selectableMapping.getSelectionExpression()), processingState -> {
            final int jdbcPosition = jdbcResultsMetadata.resolveColumnPosition(columnName);
            final BasicValuedMapping basicType = (BasicValuedMapping) selectableMapping.getJdbcMapping();
            final int valuesArrayPosition = ResultsHelper.jdbcPositionToValuesArrayPosition(jdbcPosition);
            return new ResultSetMappingSqlSelection(valuesArrayPosition, basicType);
        }), selectableMapping.getJdbcMapping().getMappedJavaType(), creationStateImpl.getSessionFactory().getTypeConfiguration());
    };
    if (modelPart instanceof EntityValuedModelPart) {
        final EntityMappingType entityMappingType = ((EntityValuedModelPart) modelPart).getEntityMappingType();
        int index = entityMappingType.getIdentifierMapping().forEachSelectable(consumer);
        if (entityMappingType.getDiscriminatorMapping() != null) {
            index += entityMappingType.getDiscriminatorMapping().forEachSelectable(index, consumer);
        }
        entityMappingType.forEachSelectable(index, consumer);
    } else {
        modelPart.forEachSelectable(consumer);
    }
}
Also used : DomainResultCreationState(org.hibernate.sql.results.graph.DomainResultCreationState) Arrays(java.util.Arrays) DynamicFetchBuilderLegacy(org.hibernate.query.results.dynamic.DynamicFetchBuilderLegacy) ResultSetMappingSqlSelection(org.hibernate.query.results.ResultSetMappingSqlSelection) BiFunction(java.util.function.BiFunction) NavigablePath(org.hibernate.query.spi.NavigablePath) DomainResultCreationStateImpl(org.hibernate.query.results.DomainResultCreationStateImpl) DomainResult(org.hibernate.sql.results.graph.DomainResult) BasicValuedMapping(org.hibernate.metamodel.mapping.BasicValuedMapping) FromClauseAccessImpl(org.hibernate.query.results.FromClauseAccessImpl) EntityValuedModelPart(org.hibernate.metamodel.mapping.EntityValuedModelPart) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) ResultsHelper.impl(org.hibernate.query.results.ResultsHelper.impl) ModelPart(org.hibernate.metamodel.mapping.ModelPart) JdbcValuesMetadata(org.hibernate.sql.results.jdbc.spi.JdbcValuesMetadata) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) ResultsHelper(org.hibernate.query.results.ResultsHelper) NativeQuery(org.hibernate.query.NativeQuery) ResultBuilder(org.hibernate.query.results.ResultBuilder) SqlAliasBaseConstant(org.hibernate.sql.ast.spi.SqlAliasBaseConstant) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) SelectableConsumer(org.hibernate.metamodel.mapping.SelectableConsumer) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) BasicValuedMapping(org.hibernate.metamodel.mapping.BasicValuedMapping) EntityValuedModelPart(org.hibernate.metamodel.mapping.EntityValuedModelPart) SelectableConsumer(org.hibernate.metamodel.mapping.SelectableConsumer) ResultSetMappingSqlSelection(org.hibernate.query.results.ResultSetMappingSqlSelection) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType)

Example 4 with SelectableConsumer

use of org.hibernate.metamodel.mapping.SelectableConsumer in project hibernate-orm by hibernate.

the class UnionSubclassEntityPersister method generateSubquery.

protected String generateSubquery(Set<String> treated) {
    if (!hasSubclasses()) {
        return getTableName();
    }
    final Dialect dialect = getFactory().getJdbcServices().getDialect();
    final MappingMetamodelImplementor metamodel = getFactory().getRuntimeMetamodels().getMappingMetamodel();
    // Collect all selectables of every entity subtype and group by selection expression as well as table name
    final LinkedHashMap<String, Map<String, SelectableMapping>> selectables = new LinkedHashMap<>();
    final SelectableConsumer selectableConsumer = (i, selectable) -> {
        selectables.computeIfAbsent(selectable.getSelectionExpression(), k -> new HashMap<>()).put(selectable.getContainingTableExpression(), selectable);
    };
    // Collect the concrete subclass table names for the treated entity names
    final Set<String> treatedTableNames = new HashSet<>(treated.size());
    for (String subclassName : treated) {
        final UnionSubclassEntityPersister subPersister = (UnionSubclassEntityPersister) metamodel.getEntityDescriptor(subclassName);
        for (String subclassTableName : subPersister.getSubclassTableNames()) {
            if (ArrayHelper.indexOf(subclassSpaces, subclassTableName) != -1) {
                treatedTableNames.add(subclassTableName);
            }
        }
        subPersister.getIdentifierMapping().forEachSelectable(selectableConsumer);
        if (subPersister.getVersionMapping() != null) {
            subPersister.getVersionMapping().forEachSelectable(selectableConsumer);
        }
        subPersister.visitSubTypeAttributeMappings(attributeMapping -> attributeMapping.forEachSelectable(selectableConsumer));
    }
    // Create a union sub-query for the table names, like generateSubquery(PersistentClass model, Mapping mapping)
    final StringBuilder buf = new StringBuilder(subquery.length()).append("( ");
    for (String name : getSubclassEntityNames()) {
        final AbstractEntityPersister persister = (AbstractEntityPersister) metamodel.findEntityDescriptor(name);
        final String subclassTableName = persister.getTableName();
        if (treatedTableNames.contains(subclassTableName)) {
            buf.append("select ");
            for (Map<String, SelectableMapping> selectableMappings : selectables.values()) {
                SelectableMapping selectableMapping = selectableMappings.get(subclassTableName);
                if (selectableMapping == null) {
                    // If there is no selectable mapping for a table name, we render a null expression
                    selectableMapping = selectableMappings.values().iterator().next();
                    final int sqlType = selectableMapping.getJdbcMapping().getJdbcType().getDefaultSqlTypeCode();
                    buf.append(dialect.getSelectClauseNullString(sqlType)).append(" as ");
                }
                buf.append(new ColumnReference((String) null, selectableMapping, getFactory()).getExpressionText());
                buf.append(", ");
            }
            buf.append(persister.getDiscriminatorSQLValue()).append(" as clazz_");
            buf.append(" from ").append(subclassTableName);
            buf.append(" union ");
            if (dialect.supportsUnionAll()) {
                buf.append("all ");
            }
        }
    }
    if (buf.length() > 2) {
        // chop the last union (all)
        buf.setLength(buf.length() - (dialect.supportsUnionAll() ? 11 : 7));
    }
    return buf.append(" )").toString();
}
Also used : BasicType(org.hibernate.type.BasicType) MappingMetamodelImplementor(org.hibernate.metamodel.spi.MappingMetamodelImplementor) IdentityGenerator(org.hibernate.id.IdentityGenerator) JoinedList(org.hibernate.internal.util.collections.JoinedList) SqlAstCreationContext(org.hibernate.sql.ast.spi.SqlAstCreationContext) PersistentClass(org.hibernate.mapping.PersistentClass) ExecuteUpdateResultCheckStyle(org.hibernate.engine.spi.ExecuteUpdateResultCheckStyle) Map(java.util.Map) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) Column(org.hibernate.mapping.Column) NavigablePath(org.hibernate.query.spi.NavigablePath) Set(java.util.Set) Subclass(org.hibernate.mapping.Subclass) SqlAliasBase(org.hibernate.sql.ast.spi.SqlAliasBase) Serializable(java.io.Serializable) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) ArrayHelper(org.hibernate.internal.util.collections.ArrayHelper) List(java.util.List) PersisterCreationContext(org.hibernate.persister.spi.PersisterCreationContext) Dialect(org.hibernate.dialect.Dialect) RuntimeModelCreationContext(org.hibernate.metamodel.spi.RuntimeModelCreationContext) MappingException(org.hibernate.MappingException) HibernateException(org.hibernate.HibernateException) SelectableConsumer(org.hibernate.metamodel.mapping.SelectableConsumer) AssertionFailure(org.hibernate.AssertionFailure) SqlStringGenerationContext(org.hibernate.boot.model.relational.SqlStringGenerationContext) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference) HashMap(java.util.HashMap) EntityDataAccess(org.hibernate.cache.spi.access.EntityDataAccess) Metadata(org.hibernate.boot.Metadata) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) UnionTableGroup(org.hibernate.sql.ast.tree.from.UnionTableGroup) NamedTableReference(org.hibernate.sql.ast.tree.from.NamedTableReference) StaticFilterAliasGenerator(org.hibernate.internal.StaticFilterAliasGenerator) UnionTableReference(org.hibernate.sql.ast.tree.from.UnionTableReference) FilterAliasGenerator(org.hibernate.internal.FilterAliasGenerator) LinkedHashSet(java.util.LinkedHashSet) Predicate(org.hibernate.sql.ast.tree.predicate.Predicate) Iterator(java.util.Iterator) EntityDiscriminatorMapping(org.hibernate.metamodel.mapping.EntityDiscriminatorMapping) Table(org.hibernate.mapping.Table) MappingModelCreationProcess(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess) Consumer(java.util.function.Consumer) StandardBasicTypes(org.hibernate.type.StandardBasicTypes) FromClauseAccess(org.hibernate.sql.ast.spi.FromClauseAccess) SelectableMapping(org.hibernate.metamodel.mapping.SelectableMapping) NaturalIdDataAccess(org.hibernate.cache.spi.access.NaturalIdDataAccess) Collections(java.util.Collections) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) Type(org.hibernate.type.Type) SelectableMapping(org.hibernate.metamodel.mapping.SelectableMapping) SelectableConsumer(org.hibernate.metamodel.mapping.SelectableConsumer) LinkedHashMap(java.util.LinkedHashMap) Dialect(org.hibernate.dialect.Dialect) MappingMetamodelImplementor(org.hibernate.metamodel.spi.MappingMetamodelImplementor) Map(java.util.Map) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference)

Aggregations

SelectableConsumer (org.hibernate.metamodel.mapping.SelectableConsumer)4 NavigablePath (org.hibernate.query.spi.NavigablePath)4 SqlExpressionResolver (org.hibernate.sql.ast.spi.SqlExpressionResolver)4 TableGroup (org.hibernate.sql.ast.tree.from.TableGroup)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)3 Collections (java.util.Collections)2 BiFunction (java.util.function.BiFunction)2 Consumer (java.util.function.Consumer)2 BasicValuedMapping (org.hibernate.metamodel.mapping.BasicValuedMapping)2 EntityDiscriminatorMapping (org.hibernate.metamodel.mapping.EntityDiscriminatorMapping)2 ToOneAttributeMapping (org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping)2 SqlExpressionResolver.createColumnReferenceKey (org.hibernate.sql.ast.spi.SqlExpressionResolver.createColumnReferenceKey)2 TableReference (org.hibernate.sql.ast.tree.from.TableReference)2 DomainResultCreationState (org.hibernate.sql.results.graph.DomainResultCreationState)2 Serializable (java.io.Serializable)1 Arrays (java.util.Arrays)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1