Search in sources :

Example 1 with BasicFetch

use of org.hibernate.sql.results.graph.basic.BasicFetch in project hibernate-orm by hibernate.

the class EntityVersionMappingImpl method generateFetch.

@Override
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState) {
    final SqlAstCreationState sqlAstCreationState = creationState.getSqlAstCreationState();
    final TableGroup tableGroup = sqlAstCreationState.getFromClauseAccess().findTableGroup(fetchParent.getNavigablePath());
    final SqlExpressionResolver sqlExpressionResolver = sqlAstCreationState.getSqlExpressionResolver();
    final TableReference columnTableReference = tableGroup.resolveTableReference(fetchablePath, columnTableExpression);
    final SqlSelection sqlSelection = sqlExpressionResolver.resolveSqlSelection(sqlExpressionResolver.resolveSqlExpression(SqlExpressionResolver.createColumnReferenceKey(columnTableReference, columnExpression), sqlAstProcessingState -> new ColumnReference(columnTableReference, columnExpression, false, null, null, versionBasicType, sqlAstCreationState.getCreationContext().getSessionFactory())), versionBasicType.getJdbcMapping().getJavaTypeDescriptor(), sqlAstCreationState.getCreationContext().getSessionFactory().getTypeConfiguration());
    return new BasicFetch<>(sqlSelection.getValuesArrayPosition(), fetchParent, fetchablePath, this, null, fetchTiming, creationState);
}
Also used : DomainResultCreationState(org.hibernate.sql.results.graph.DomainResultCreationState) JdbcMapping(org.hibernate.metamodel.mapping.JdbcMapping) BasicType(org.hibernate.type.BasicType) UnsavedValueFactory(org.hibernate.engine.internal.UnsavedValueFactory) RootClass(org.hibernate.mapping.RootClass) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference) JavaType(org.hibernate.type.descriptor.java.JavaType) Clause(org.hibernate.sql.ast.Clause) Supplier(java.util.function.Supplier) BasicFetch(org.hibernate.sql.results.graph.basic.BasicFetch) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) MappingType(org.hibernate.metamodel.mapping.MappingType) TableReference(org.hibernate.sql.ast.tree.from.TableReference) FetchOptions(org.hibernate.sql.results.graph.FetchOptions) BiConsumer(java.util.function.BiConsumer) EntityVersionMapping(org.hibernate.metamodel.mapping.EntityVersionMapping) SqlSelection(org.hibernate.sql.ast.spi.SqlSelection) SqlAstCreationState(org.hibernate.sql.ast.spi.SqlAstCreationState) FetchTiming(org.hibernate.engine.FetchTiming) NavigablePath(org.hibernate.query.spi.NavigablePath) DomainResult(org.hibernate.sql.results.graph.DomainResult) VersionJavaType(org.hibernate.type.descriptor.java.VersionJavaType) Fetch(org.hibernate.sql.results.graph.Fetch) BasicResult(org.hibernate.sql.results.graph.basic.BasicResult) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) NavigableRole(org.hibernate.metamodel.model.domain.NavigableRole) FetchStyle(org.hibernate.engine.FetchStyle) VersionValue(org.hibernate.engine.spi.VersionValue) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) KeyValue(org.hibernate.mapping.KeyValue) IndexedConsumer(org.hibernate.mapping.IndexedConsumer) FetchParent(org.hibernate.sql.results.graph.FetchParent) BasicFetch(org.hibernate.sql.results.graph.basic.BasicFetch) TableReference(org.hibernate.sql.ast.tree.from.TableReference) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) SqlAstCreationState(org.hibernate.sql.ast.spi.SqlAstCreationState) SqlSelection(org.hibernate.sql.ast.spi.SqlSelection) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference)

Example 2 with BasicFetch

use of org.hibernate.sql.results.graph.basic.BasicFetch in project hibernate-orm by hibernate.

the class BasicEntityIdentifierMappingImpl method generateFetch.

@Override
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState) {
    final SqlAstCreationState sqlAstCreationState = creationState.getSqlAstCreationState();
    final TableGroup tableGroup = sqlAstCreationState.getFromClauseAccess().getTableGroup(fetchParent.getNavigablePath());
    assert tableGroup != null;
    final SqlSelection sqlSelection = resolveSqlSelection(fetchablePath, tableGroup, false, creationState);
    return new BasicFetch<>(sqlSelection.getValuesArrayPosition(), fetchParent, fetchablePath, this, null, FetchTiming.IMMEDIATE, creationState);
}
Also used : BasicFetch(org.hibernate.sql.results.graph.basic.BasicFetch) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) SqlAstCreationState(org.hibernate.sql.ast.spi.SqlAstCreationState) SqlSelection(org.hibernate.sql.ast.spi.SqlSelection)

Example 3 with BasicFetch

use of org.hibernate.sql.results.graph.basic.BasicFetch in project hibernate-orm by hibernate.

the class BasicAttributeMapping method generateFetch.

@Override
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState) {
    final int valuesArrayPosition;
    // Lazy property. A valuesArrayPosition of -1 will lead to
    // returning a domain result assembler that returns LazyPropertyInitializer.UNFETCHED_PROPERTY
    final EntityMappingType containingEntityMapping = findContainingEntityMapping();
    if (fetchTiming == FetchTiming.DELAYED && containingEntityMapping.getEntityPersister().getPropertyLaziness()[getStateArrayPosition()]) {
        valuesArrayPosition = -1;
    } else {
        final SqlAstCreationState sqlAstCreationState = creationState.getSqlAstCreationState();
        final TableGroup tableGroup = sqlAstCreationState.getFromClauseAccess().getTableGroup(fetchParent.getNavigablePath());
        assert tableGroup != null;
        final SqlSelection sqlSelection = resolveSqlSelection(fetchablePath, tableGroup, true, creationState);
        valuesArrayPosition = sqlSelection.getValuesArrayPosition();
    }
    return new BasicFetch<>(valuesArrayPosition, fetchParent, fetchablePath, this, valueConverter, fetchTiming, creationState);
}
Also used : BasicFetch(org.hibernate.sql.results.graph.basic.BasicFetch) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) SqlAstCreationState(org.hibernate.sql.ast.spi.SqlAstCreationState) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) SqlSelection(org.hibernate.sql.ast.spi.SqlSelection)

Example 4 with BasicFetch

use of org.hibernate.sql.results.graph.basic.BasicFetch in project hibernate-orm by hibernate.

the class CollectionIdentifierDescriptorImpl method generateFetch.

@Override
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState) {
    // get the collection TableGroup
    final FromClauseAccess fromClauseAccess = creationState.getSqlAstCreationState().getFromClauseAccess();
    final TableGroup tableGroup = fromClauseAccess.getTableGroup(fetchablePath.getParent());
    final SqlAstCreationState astCreationState = creationState.getSqlAstCreationState();
    final SqlAstCreationContext astCreationContext = astCreationState.getCreationContext();
    final SessionFactoryImplementor sessionFactory = astCreationContext.getSessionFactory();
    final SqlExpressionResolver sqlExpressionResolver = astCreationState.getSqlExpressionResolver();
    final SqlSelection sqlSelection = sqlExpressionResolver.resolveSqlSelection(sqlExpressionResolver.resolveSqlExpression(SqlExpressionResolver.createColumnReferenceKey(tableGroup.getPrimaryTableReference(), columnName), p -> new ColumnReference(tableGroup.getPrimaryTableReference().getIdentificationVariable(), columnName, false, null, null, type, sessionFactory)), type.getJavaTypeDescriptor(), sessionFactory.getTypeConfiguration());
    return new BasicFetch<>(sqlSelection.getValuesArrayPosition(), fetchParent, fetchablePath, this, null, FetchTiming.IMMEDIATE, creationState);
}
Also used : DomainResultCreationState(org.hibernate.sql.results.graph.DomainResultCreationState) JdbcMapping(org.hibernate.metamodel.mapping.JdbcMapping) BasicType(org.hibernate.type.BasicType) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference) JavaType(org.hibernate.type.descriptor.java.JavaType) CollectionIdentifierDescriptor(org.hibernate.metamodel.mapping.CollectionIdentifierDescriptor) Clause(org.hibernate.sql.ast.Clause) BasicFetch(org.hibernate.sql.results.graph.basic.BasicFetch) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) MappingType(org.hibernate.metamodel.mapping.MappingType) SqlAstCreationContext(org.hibernate.sql.ast.spi.SqlAstCreationContext) FetchOptions(org.hibernate.sql.results.graph.FetchOptions) BiConsumer(java.util.function.BiConsumer) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) SqlSelection(org.hibernate.sql.ast.spi.SqlSelection) SqlAstCreationState(org.hibernate.sql.ast.spi.SqlAstCreationState) FetchTiming(org.hibernate.engine.FetchTiming) NavigablePath(org.hibernate.query.spi.NavigablePath) DomainResult(org.hibernate.sql.results.graph.DomainResult) Fetch(org.hibernate.sql.results.graph.Fetch) BasicResult(org.hibernate.sql.results.graph.basic.BasicResult) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) NavigableRole(org.hibernate.metamodel.model.domain.NavigableRole) FetchStyle(org.hibernate.engine.FetchStyle) FromClauseAccess(org.hibernate.sql.ast.spi.FromClauseAccess) CollectionPersister(org.hibernate.persister.collection.CollectionPersister) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) IndexedConsumer(org.hibernate.mapping.IndexedConsumer) FetchParent(org.hibernate.sql.results.graph.FetchParent) BasicFetch(org.hibernate.sql.results.graph.basic.BasicFetch) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) FromClauseAccess(org.hibernate.sql.ast.spi.FromClauseAccess) SqlAstCreationContext(org.hibernate.sql.ast.spi.SqlAstCreationContext) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) SqlAstCreationState(org.hibernate.sql.ast.spi.SqlAstCreationState) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) SqlSelection(org.hibernate.sql.ast.spi.SqlSelection) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference)

Example 5 with BasicFetch

use of org.hibernate.sql.results.graph.basic.BasicFetch in project hibernate-orm by hibernate.

the class InsertExecutionDelegate method insertRootTable.

private void insertRootTable(String tableExpression, int rows, String[] keyColumns, ExecutionContext executionContext) {
    final TableReference updatingTableReference = updatingTableGroup.getTableReference(updatingTableGroup.getNavigablePath(), tableExpression, true, true);
    final IdentifierGenerator identifierGenerator = entityDescriptor.getEntityPersister().getIdentifierGenerator();
    final List<Assignment> assignments = assignmentsByTable.get(updatingTableReference);
    if ((assignments == null || assignments.isEmpty()) && !(identifierGenerator instanceof PostInsertIdentifierGenerator)) {
        throw new IllegalStateException("There must be at least a single root table assignment");
    }
    final NamedTableReference dmlTableReference = resolveUnionTableReference(updatingTableReference, tableExpression);
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Create the SQL AST and convert it into a JdbcOperation
    final QuerySpec querySpec = new QuerySpec(true);
    final NamedTableReference temporaryTableReference = new NamedTableReference(insertStatement.getTargetTable().getTableExpression(), updatingTableReference.getIdentificationVariable(), false, sessionFactory);
    final TableGroupImpl temporaryTableGroup = new TableGroupImpl(updatingTableGroup.getNavigablePath(), null, temporaryTableReference, entityDescriptor);
    querySpec.getFromClause().addRoot(temporaryTableGroup);
    final InsertStatement insertStatement = new InsertStatement(dmlTableReference);
    insertStatement.setSourceSelectStatement(querySpec);
    for (Assignment assignment : assignments) {
        insertStatement.addTargetColumnReferences(assignment.getAssignable().getColumnReferences());
        for (ColumnReference columnReference : assignment.getAssignable().getColumnReferences()) {
            querySpec.getSelectClause().addSqlSelection(new SqlSelectionImpl(1, 0, new ColumnReference(updatingTableReference.getIdentificationVariable(), columnReference.getColumnExpression(), false, null, null, columnReference.getJdbcMapping(), sessionFactory)));
        }
    }
    final JdbcServices jdbcServices = sessionFactory.getJdbcServices();
    final Map<Object, Object> entityTableToRootIdentity;
    if (identifierGenerator instanceof PostInsertIdentifierGenerator) {
        final BasicEntityIdentifierMapping identifierMapping = (BasicEntityIdentifierMapping) entityDescriptor.getIdentifierMapping();
        final QuerySpec idSelectQuerySpec = new QuerySpec(true);
        idSelectQuerySpec.getFromClause().addRoot(temporaryTableGroup);
        final ColumnReference columnReference = new ColumnReference((String) null, TemporaryTable.ENTITY_TABLE_IDENTITY_COLUMN, false, null, null, identifierMapping.getJdbcMapping(), sessionFactory);
        idSelectQuerySpec.getSelectClause().addSqlSelection(new SqlSelectionImpl(1, 0, columnReference));
        idSelectQuerySpec.addSortSpecification(new SortSpecification(columnReference, SortOrder.ASCENDING));
        final SelectStatement selectStatement = new SelectStatement(idSelectQuerySpec, Collections.singletonList(new BasicFetch<>(0, null, null, identifierMapping, null, FetchTiming.IMMEDIATE, null)));
        final JdbcSelect jdbcSelect = jdbcServices.getJdbcEnvironment().getSqlAstTranslatorFactory().buildSelectTranslator(sessionFactory, selectStatement).translate(null, executionContext.getQueryOptions());
        final List<Object> list = jdbcServices.getJdbcSelectExecutor().list(jdbcSelect, JdbcParameterBindings.NO_BINDINGS, executionContext, null, ListResultsConsumer.UniqueSemantic.NONE);
        entityTableToRootIdentity = new LinkedHashMap<>(list.size());
        for (Object o : list) {
            entityTableToRootIdentity.put(o, null);
        }
        querySpec.applyPredicate(new ComparisonPredicate(columnReference, ComparisonOperator.EQUAL, new JdbcParameterImpl(identifierMapping.getJdbcMapping())));
    } else {
        entityTableToRootIdentity = null;
        if (identifierGenerator instanceof OptimizableGenerator) {
            final Optimizer optimizer = ((OptimizableGenerator) identifierGenerator).getOptimizer();
            // but only if the target paths don't already contain the id
            if (optimizer != null && optimizer.getIncrementSize() > 1 && insertStatement.getTargetColumnReferences().stream().noneMatch(c -> keyColumns[0].equals(c.getColumnExpression()))) {
                final BasicEntityIdentifierMapping identifierMapping = (BasicEntityIdentifierMapping) entityDescriptor.getIdentifierMapping();
                final JdbcParameter rowNumber = new JdbcParameterImpl(identifierMapping.getJdbcMapping());
                final JdbcParameter rootIdentity = new JdbcParameterImpl(identifierMapping.getJdbcMapping());
                final List<Assignment> temporaryTableAssignments = new ArrayList<>(1);
                final ColumnReference idColumnReference = new ColumnReference((String) null, identifierMapping, sessionFactory);
                temporaryTableAssignments.add(new Assignment(idColumnReference, rootIdentity));
                final TemporaryTableColumn rowNumberColumn = entityTable.getColumns().get(entityTable.getColumns().size() - 1);
                final UpdateStatement updateStatement = new UpdateStatement(temporaryTableReference, temporaryTableAssignments, new ComparisonPredicate(new ColumnReference((String) null, rowNumberColumn.getColumnName(), false, null, null, rowNumberColumn.getJdbcMapping(), sessionFactory), ComparisonOperator.EQUAL, rowNumber));
                final JdbcUpdate jdbcUpdate = jdbcServices.getJdbcEnvironment().getSqlAstTranslatorFactory().buildUpdateTranslator(sessionFactory, updateStatement).translate(null, executionContext.getQueryOptions());
                final JdbcParameterBindings updateBindings = new JdbcParameterBindingsImpl(2);
                for (int i = 0; i < rows; i++) {
                    updateBindings.addBinding(rowNumber, new JdbcParameterBindingImpl(rowNumberColumn.getJdbcMapping(), i + 1));
                    updateBindings.addBinding(rootIdentity, new JdbcParameterBindingImpl(identifierMapping.getJdbcMapping(), identifierGenerator.generate(executionContext.getSession(), null)));
                    jdbcServices.getJdbcMutationExecutor().execute(jdbcUpdate, updateBindings, sql -> executionContext.getSession().getJdbcCoordinator().getStatementPreparer().prepareStatement(sql), (integer, preparedStatement) -> {
                    }, executionContext);
                }
                insertStatement.addTargetColumnReferences(new ColumnReference((String) null, keyColumns[0], false, null, null, identifierMapping.getJdbcMapping(), sessionFactory));
                querySpec.getSelectClause().addSqlSelection(new SqlSelectionImpl(1, 0, new ColumnReference(updatingTableReference.getIdentificationVariable(), idColumnReference.getColumnExpression(), false, null, null, idColumnReference.getJdbcMapping(), sessionFactory)));
            }
        }
    }
    final JdbcInsert jdbcInsert = jdbcServices.getJdbcEnvironment().getSqlAstTranslatorFactory().buildInsertTranslator(sessionFactory, insertStatement).translate(null, executionContext.getQueryOptions());
    if (identifierGenerator instanceof PostInsertIdentifierGenerator) {
        final PostInsertIdentifierGenerator generator = (PostInsertIdentifierGenerator) identifierGenerator;
        final boolean generatedKeysEnabled = sessionFactory.getSessionFactoryOptions().isGetGeneratedKeysEnabled();
        final InsertGeneratedIdentifierDelegate identifierDelegate = generator.getInsertGeneratedIdentifierDelegate((PostInsertIdentityPersister) entityDescriptor.getEntityPersister(), jdbcServices.getDialect(), generatedKeysEnabled);
        final String finalSql = identifierDelegate.prepareIdentifierGeneratingInsert(jdbcInsert.getSql());
        final BasicEntityIdentifierMapping identifierMapping = (BasicEntityIdentifierMapping) entityDescriptor.getIdentifierMapping();
        final ValueBinder jdbcValueBinder = identifierMapping.getJdbcMapping().getJdbcValueBinder();
        for (Map.Entry<Object, Object> entry : entityTableToRootIdentity.entrySet()) {
            final Object rootIdentity = identifierDelegate.performInsert(finalSql, executionContext.getSession(), new Binder() {

                @Override
                public void bindValues(PreparedStatement ps) throws SQLException {
                    jdbcValueBinder.bind(ps, entry.getKey(), 1, executionContext.getSession());
                }

                @Override
                public Object getEntity() {
                    return null;
                }
            });
            entry.setValue(rootIdentity);
        }
        final JdbcParameter entityIdentity = new JdbcParameterImpl(identifierMapping.getJdbcMapping());
        final JdbcParameter rootIdentity = new JdbcParameterImpl(identifierMapping.getJdbcMapping());
        final List<Assignment> temporaryTableAssignments = new ArrayList<>(1);
        temporaryTableAssignments.add(new Assignment(new ColumnReference((String) null, identifierMapping, sessionFactory), rootIdentity));
        final UpdateStatement updateStatement = new UpdateStatement(temporaryTableReference, temporaryTableAssignments, new ComparisonPredicate(new ColumnReference((String) null, TemporaryTable.ENTITY_TABLE_IDENTITY_COLUMN, false, null, null, identifierMapping.getJdbcMapping(), sessionFactory), ComparisonOperator.EQUAL, entityIdentity));
        final JdbcUpdate jdbcUpdate = jdbcServices.getJdbcEnvironment().getSqlAstTranslatorFactory().buildUpdateTranslator(sessionFactory, updateStatement).translate(null, executionContext.getQueryOptions());
        final JdbcParameterBindings updateBindings = new JdbcParameterBindingsImpl(2);
        for (Map.Entry<Object, Object> entry : entityTableToRootIdentity.entrySet()) {
            updateBindings.addBinding(entityIdentity, new JdbcParameterBindingImpl(identifierMapping.getJdbcMapping(), entry.getKey()));
            updateBindings.addBinding(rootIdentity, new JdbcParameterBindingImpl(identifierMapping.getJdbcMapping(), entry.getValue()));
            jdbcServices.getJdbcMutationExecutor().execute(jdbcUpdate, updateBindings, sql -> executionContext.getSession().getJdbcCoordinator().getStatementPreparer().prepareStatement(sql), (integer, preparedStatement) -> {
            }, executionContext);
        }
    } else {
        jdbcServices.getJdbcMutationExecutor().execute(jdbcInsert, JdbcParameterBindings.NO_BINDINGS, sql -> executionContext.getSession().getJdbcCoordinator().getStatementPreparer().prepareStatement(sql), (integer, preparedStatement) -> {
        }, executionContext);
    }
}
Also used : CollectionHelper(org.hibernate.internal.util.collections.CollectionHelper) ExecutionContext(org.hibernate.sql.exec.spi.ExecutionContext) ValueBinder(org.hibernate.type.descriptor.ValueBinder) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) ComparisonPredicate(org.hibernate.sql.ast.tree.predicate.ComparisonPredicate) SqmUtil(org.hibernate.query.sqm.internal.SqmUtil) PostInsertIdentifierGenerator(org.hibernate.id.PostInsertIdentifierGenerator) Map(java.util.Map) JdbcParameterImpl(org.hibernate.sql.exec.internal.JdbcParameterImpl) Binder(org.hibernate.id.insert.Binder) ComparisonOperator(org.hibernate.query.sqm.ComparisonOperator) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) IdentifierGenerator(org.hibernate.id.IdentifierGenerator) Assignable(org.hibernate.sql.ast.tree.update.Assignable) Assignment(org.hibernate.sql.ast.tree.update.Assignment) Optimizer(org.hibernate.id.enhanced.Optimizer) PreparedStatement(java.sql.PreparedStatement) UpdateStatement(org.hibernate.sql.ast.tree.update.UpdateStatement) SelectStatement(org.hibernate.sql.ast.tree.select.SelectStatement) List(java.util.List) JdbcUpdate(org.hibernate.sql.exec.spi.JdbcUpdate) SqmParameter(org.hibernate.query.sqm.tree.expression.SqmParameter) AbstractEntityPersister(org.hibernate.persister.entity.AbstractEntityPersister) InsertStatement(org.hibernate.sql.ast.tree.insert.InsertStatement) QuerySpec(org.hibernate.sql.ast.tree.select.QuerySpec) TemporaryTableColumn(org.hibernate.dialect.temptable.TemporaryTableColumn) MappingModelExpressible(org.hibernate.metamodel.mapping.MappingModelExpressible) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) BasicEntityIdentifierMapping(org.hibernate.metamodel.mapping.BasicEntityIdentifierMapping) JdbcParameterBindingsImpl(org.hibernate.sql.exec.internal.JdbcParameterBindingsImpl) TableGroupImpl(org.hibernate.query.results.TableGroupImpl) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference) OptimizableGenerator(org.hibernate.id.OptimizableGenerator) Function(java.util.function.Function) SemanticException(org.hibernate.query.SemanticException) SortOrder(org.hibernate.query.sqm.SortOrder) JdbcParameterBindings(org.hibernate.sql.exec.spi.JdbcParameterBindings) BasicFetch(org.hibernate.sql.results.graph.basic.BasicFetch) SortSpecification(org.hibernate.sql.ast.tree.select.SortSpecification) ArrayList(java.util.ArrayList) TableReference(org.hibernate.sql.ast.tree.from.TableReference) LinkedHashMap(java.util.LinkedHashMap) NamedTableReference(org.hibernate.sql.ast.tree.from.NamedTableReference) SQLException(java.sql.SQLException) MultiTableSqmMutationConverter(org.hibernate.query.sqm.mutation.internal.MultiTableSqmMutationConverter) JdbcInsert(org.hibernate.sql.exec.spi.JdbcInsert) SqmParameterMappingModelResolutionAccess(org.hibernate.query.sqm.spi.SqmParameterMappingModelResolutionAccess) UnionTableReference(org.hibernate.sql.ast.tree.from.UnionTableReference) PostInsertIdentityPersister(org.hibernate.id.PostInsertIdentityPersister) FetchTiming(org.hibernate.engine.FetchTiming) InsertGeneratedIdentifierDelegate(org.hibernate.id.insert.InsertGeneratedIdentifierDelegate) TemporaryTable(org.hibernate.dialect.temptable.TemporaryTable) ListResultsConsumer(org.hibernate.sql.results.spi.ListResultsConsumer) ModelPartContainer(org.hibernate.metamodel.mapping.ModelPartContainer) JdbcServices(org.hibernate.engine.jdbc.spi.JdbcServices) DomainQueryExecutionContext(org.hibernate.query.spi.DomainQueryExecutionContext) JdbcParameter(org.hibernate.sql.ast.tree.expression.JdbcParameter) JdbcParameterBindingImpl(org.hibernate.sql.exec.internal.JdbcParameterBindingImpl) SqmInsertStatement(org.hibernate.query.sqm.tree.insert.SqmInsertStatement) SqlSelectionImpl(org.hibernate.sql.results.internal.SqlSelectionImpl) DomainParameterXref(org.hibernate.query.sqm.internal.DomainParameterXref) Collections(java.util.Collections) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) JdbcSelect(org.hibernate.sql.exec.spi.JdbcSelect) SQLException(java.sql.SQLException) OptimizableGenerator(org.hibernate.id.OptimizableGenerator) Optimizer(org.hibernate.id.enhanced.Optimizer) ArrayList(java.util.ArrayList) JdbcServices(org.hibernate.engine.jdbc.spi.JdbcServices) TemporaryTableColumn(org.hibernate.dialect.temptable.TemporaryTableColumn) InsertStatement(org.hibernate.sql.ast.tree.insert.InsertStatement) SqmInsertStatement(org.hibernate.query.sqm.tree.insert.SqmInsertStatement) ComparisonPredicate(org.hibernate.sql.ast.tree.predicate.ComparisonPredicate) Assignment(org.hibernate.sql.ast.tree.update.Assignment) SelectStatement(org.hibernate.sql.ast.tree.select.SelectStatement) ValueBinder(org.hibernate.type.descriptor.ValueBinder) Binder(org.hibernate.id.insert.Binder) TableReference(org.hibernate.sql.ast.tree.from.TableReference) NamedTableReference(org.hibernate.sql.ast.tree.from.NamedTableReference) UnionTableReference(org.hibernate.sql.ast.tree.from.UnionTableReference) JdbcUpdate(org.hibernate.sql.exec.spi.JdbcUpdate) TableGroupImpl(org.hibernate.query.results.TableGroupImpl) JdbcParameterImpl(org.hibernate.sql.exec.internal.JdbcParameterImpl) BasicFetch(org.hibernate.sql.results.graph.basic.BasicFetch) JdbcSelect(org.hibernate.sql.exec.spi.JdbcSelect) UpdateStatement(org.hibernate.sql.ast.tree.update.UpdateStatement) NamedTableReference(org.hibernate.sql.ast.tree.from.NamedTableReference) JdbcParameterBindingsImpl(org.hibernate.sql.exec.internal.JdbcParameterBindingsImpl) JdbcParameter(org.hibernate.sql.ast.tree.expression.JdbcParameter) JdbcParameterBindingImpl(org.hibernate.sql.exec.internal.JdbcParameterBindingImpl) PreparedStatement(java.sql.PreparedStatement) BasicEntityIdentifierMapping(org.hibernate.metamodel.mapping.BasicEntityIdentifierMapping) InsertGeneratedIdentifierDelegate(org.hibernate.id.insert.InsertGeneratedIdentifierDelegate) PostInsertIdentifierGenerator(org.hibernate.id.PostInsertIdentifierGenerator) JdbcInsert(org.hibernate.sql.exec.spi.JdbcInsert) SortSpecification(org.hibernate.sql.ast.tree.select.SortSpecification) SqlSelectionImpl(org.hibernate.sql.results.internal.SqlSelectionImpl) ValueBinder(org.hibernate.type.descriptor.ValueBinder) QuerySpec(org.hibernate.sql.ast.tree.select.QuerySpec) Map(java.util.Map) LinkedHashMap(java.util.LinkedHashMap) PostInsertIdentifierGenerator(org.hibernate.id.PostInsertIdentifierGenerator) IdentifierGenerator(org.hibernate.id.IdentifierGenerator) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference) JdbcParameterBindings(org.hibernate.sql.exec.spi.JdbcParameterBindings)

Aggregations

TableGroup (org.hibernate.sql.ast.tree.from.TableGroup)11 BasicFetch (org.hibernate.sql.results.graph.basic.BasicFetch)11 SqlSelection (org.hibernate.sql.ast.spi.SqlSelection)9 SqlAstCreationState (org.hibernate.sql.ast.spi.SqlAstCreationState)6 ColumnReference (org.hibernate.sql.ast.tree.expression.ColumnReference)5 TableReference (org.hibernate.sql.ast.tree.from.TableReference)5 SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)4 EntityMappingType (org.hibernate.metamodel.mapping.EntityMappingType)4 SqlExpressionResolver (org.hibernate.sql.ast.spi.SqlExpressionResolver)4 FetchTiming (org.hibernate.engine.FetchTiming)3 SharedSessionContractImplementor (org.hibernate.engine.spi.SharedSessionContractImplementor)3 NavigablePath (org.hibernate.query.spi.NavigablePath)3 Expression (org.hibernate.sql.ast.tree.expression.Expression)3 BiConsumer (java.util.function.BiConsumer)2 FetchStyle (org.hibernate.engine.FetchStyle)2 IndexedConsumer (org.hibernate.mapping.IndexedConsumer)2 JdbcMapping (org.hibernate.metamodel.mapping.JdbcMapping)2 MappingType (org.hibernate.metamodel.mapping.MappingType)2 NavigableRole (org.hibernate.metamodel.model.domain.NavigableRole)2 DomainResultCreationStateImpl (org.hibernate.query.results.DomainResultCreationStateImpl)2