Search in sources :

Example 26 with AttributeMapping

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

the class AbstractEntityPersister method generateInsertString.

/**
 * Generate the SQL that inserts a row
 */
public String generateInsertString(boolean[] includeProperty, int j) {
    final Insert insert = createInsert().setTableName(getTableName(j));
    for (int index = 0; index < attributeMappings.size(); index++) {
        final AttributeMapping attributeMapping = attributeMappings.get(index);
        if (isPropertyOfTable(index, j)) {
            if (!lobProperties.contains(index)) {
                if (includeProperty[index]) {
                    insert.addColumns(getPropertyColumnNames(index), propertyColumnInsertable[index], propertyColumnWriters[index]);
                } else {
                    final ValueGeneration valueGeneration = attributeMapping.getValueGeneration();
                    if (valueGeneration.getGenerationTiming().includesInsert() && valueGeneration.getValueGenerator() == null && valueGeneration.referenceColumnInSql()) {
                        insert.addColumns(getPropertyColumnNames(index), SINGLE_TRUE, new String[] { valueGeneration.getDatabaseGeneratedReferencedColumnValue() });
                    }
                }
            }
        }
    }
    // add the discriminator
    if (j == 0) {
        addDiscriminatorToInsert(insert);
    }
    // add the primary key
    insert.addColumns(getKeyColumns(j));
    if (getFactory().getSessionFactoryOptions().isCommentsEnabled()) {
        insert.setComment("insert " + getEntityName());
    }
    // and updates.  Insert them at the end.
    for (int i : lobProperties) {
        if (includeProperty[i] && isPropertyOfTable(i, j)) {
            // this property belongs on the table and is to be inserted
            insert.addColumns(getPropertyColumnNames(i), propertyColumnInsertable[i], propertyColumnWriters[i]);
        }
    }
    return insert.toStatementString();
}
Also used : ValueGeneration(org.hibernate.tuple.ValueGeneration) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) EmbeddedAttributeMapping(org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping) DiscriminatedAssociationAttributeMapping(org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationAttributeMapping) ToOneAttributeMapping(org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping) SingularAttributeMapping(org.hibernate.metamodel.mapping.SingularAttributeMapping) AttributeMapping(org.hibernate.metamodel.mapping.AttributeMapping) Insert(org.hibernate.sql.Insert)

Example 27 with AttributeMapping

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

the class AbstractEmbeddableInitializer method applyMapsId.

private void applyMapsId(RowProcessingState processingState) {
    final SharedSessionContractImplementor session = processingState.getSession();
    if (embedded instanceof CompositeIdentifierMapping) {
        final CompositeIdentifierMapping cid = (CompositeIdentifierMapping) embedded;
        final EmbeddableMappingType mappedIdEmbeddable = cid.getMappedIdEmbeddableTypeDescriptor();
        if (cid.hasContainingClass()) {
            final EmbeddableMappingType virtualIdEmbeddable = embedded.getEmbeddableTypeDescriptor();
            if (virtualIdEmbeddable == mappedIdEmbeddable) {
                return;
            }
            virtualIdEmbeddable.forEachAttributeMapping((position, virtualIdAttribute) -> {
                final AttributeMapping mappedIdAttribute = mappedIdEmbeddable.getAttributeMapping(position);
                if (virtualIdAttribute instanceof ToOneAttributeMapping && !(mappedIdAttribute instanceof ToOneAttributeMapping)) {
                    final ToOneAttributeMapping toOneAttributeMapping = (ToOneAttributeMapping) virtualIdAttribute;
                    final ForeignKeyDescriptor fkDescriptor = toOneAttributeMapping.getForeignKeyDescriptor();
                    final Object associationKey = fkDescriptor.getAssociationKeyFromSide(rowState[position], toOneAttributeMapping.getSideNature().inverse(), session);
                    rowState[position] = associationKey;
                }
            });
        }
    }
}
Also used : ToOneAttributeMapping(org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping) ForeignKeyDescriptor(org.hibernate.metamodel.mapping.ForeignKeyDescriptor) ToOneAttributeMapping(org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping) AttributeMapping(org.hibernate.metamodel.mapping.AttributeMapping) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) CompositeIdentifierMapping(org.hibernate.metamodel.mapping.CompositeIdentifierMapping) EmbeddableMappingType(org.hibernate.metamodel.mapping.EmbeddableMappingType)

Example 28 with AttributeMapping

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

the class EmbeddedComponentType method isMethodOf.

@Override
public boolean isMethodOf(Method method) {
    if (mappingModelPart() == null) {
        throw new IllegalStateException("EmbeddableValuedModelPart not known yet");
    }
    final EmbeddableMappingType embeddable = mappingModelPart().getEmbeddableTypeDescriptor();
    for (int i = 0; i < embeddable.getAttributeMappings().size(); i++) {
        final AttributeMapping attributeMapping = embeddable.getAttributeMapping(i);
        final Getter getter = attributeMapping.getPropertyAccess().getGetter();
        final Method getterMethod = getter.getMethod();
        if (getterMethod != null && getterMethod.equals(method)) {
            return true;
        }
    }
    return false;
}
Also used : Getter(org.hibernate.property.access.spi.Getter) AttributeMapping(org.hibernate.metamodel.mapping.AttributeMapping) Method(java.lang.reflect.Method) EmbeddableMappingType(org.hibernate.metamodel.mapping.EmbeddableMappingType)

Example 29 with AttributeMapping

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

the class LoaderSelectBuilder method createFetchableBiConsumer.

private BiConsumer<Fetchable, Boolean> createFetchableBiConsumer(FetchParent fetchParent, QuerySpec querySpec, LoaderSqlAstCreationState creationState, List<Fetch> fetches) {
    return (fetchable, isKeyFetchable) -> {
        final NavigablePath fetchablePath;
        if (isKeyFetchable) {
            final EntityIdentifierMapping identifierMapping;
            if (fetchParent instanceof BiDirectionalFetch) {
                final BiDirectionalFetch parentAsBiDirectionalFetch = (BiDirectionalFetch) fetchParent;
                final Fetchable biDirectionalFetchedMapping = parentAsBiDirectionalFetch.getFetchedMapping();
                if (biDirectionalFetchedMapping instanceof EntityValuedFetchable) {
                    identifierMapping = ((EntityValuedFetchable) biDirectionalFetchedMapping).getEntityMappingType().getIdentifierMapping();
                } else {
                    identifierMapping = null;
                }
            } else {
                final FetchableContainer fetchableContainer = fetchParent.getReferencedMappingContainer();
                if (fetchableContainer instanceof EntityValuedModelPart) {
                    final EntityValuedModelPart entityValuedModelPart = (EntityValuedModelPart) fetchableContainer;
                    identifierMapping = entityValuedModelPart.getEntityMappingType().getIdentifierMapping();
                } else {
                    identifierMapping = null;
                }
            }
            if (identifierMapping != null) {
                fetchablePath = new EntityIdentifierNavigablePath(fetchParent.getNavigablePath(), attributeName(identifierMapping));
            } else {
                fetchablePath = fetchParent.resolveNavigablePath(fetchable);
            }
        } else {
            fetchablePath = fetchParent.resolveNavigablePath(fetchable);
        }
        FetchTiming fetchTiming = fetchable.getMappedFetchOptions().getTiming();
        boolean joined = fetchable.getMappedFetchOptions().getStyle() == FetchStyle.JOIN;
        boolean explicitFetch = false;
        EntityGraphTraversalState.TraversalResult traversalResult = null;
        final boolean isFetchablePluralAttributeMapping = fetchable instanceof PluralAttributeMapping;
        if (!(fetchable instanceof CollectionPart)) {
            // 'entity graph' takes precedence over 'fetch profile'
            if (entityGraphTraversalState != null) {
                traversalResult = entityGraphTraversalState.traverse(fetchParent, fetchable, isKeyFetchable);
                fetchTiming = traversalResult.getFetchTiming();
                joined = traversalResult.isJoined();
                explicitFetch = true;
            } else if (loadQueryInfluencers.hasEnabledFetchProfiles()) {
                // There is no point in checking the fetch profile if it can't affect this fetchable
                if (fetchTiming != FetchTiming.IMMEDIATE || fetchable.incrementFetchDepth()) {
                    final String fetchableRole = fetchable.getNavigableRole().getFullPath();
                    for (String enabledFetchProfileName : loadQueryInfluencers.getEnabledFetchProfileNames()) {
                        final FetchProfile enabledFetchProfile = creationContext.getSessionFactory().getFetchProfile(enabledFetchProfileName);
                        final org.hibernate.engine.profile.Fetch profileFetch = enabledFetchProfile.getFetchByRole(fetchableRole);
                        if (profileFetch != null) {
                            fetchTiming = FetchTiming.IMMEDIATE;
                            joined = joined || profileFetch.getStyle() == org.hibernate.engine.profile.Fetch.Style.JOIN;
                            explicitFetch = true;
                        }
                    }
                }
            } else if (loadQueryInfluencers.getEnabledCascadingFetchProfile() != null) {
                final CascadeStyle cascadeStyle = ((AttributeMapping) fetchable).getAttributeMetadataAccess().resolveAttributeMetadata(fetchable.findContainingEntityMapping()).getCascadeStyle();
                final CascadingAction cascadingAction = loadQueryInfluencers.getEnabledCascadingFetchProfile().getCascadingAction();
                if (cascadeStyle == null || cascadeStyle.doCascade(cascadingAction)) {
                    fetchTiming = FetchTiming.IMMEDIATE;
                    // In 5.x the CascadeEntityJoinWalker only join fetched the first collection fetch
                    if (isFetchablePluralAttributeMapping) {
                        joined = !hasCollectionJoinFetches;
                    } else {
                        joined = true;
                    }
                }
            }
        }
        final String previousBagRole = currentBagRole;
        final String bagRole;
        if (isFetchablePluralAttributeMapping && ((PluralAttributeMapping) fetchable).getMappedType().getCollectionSemantics() instanceof BagSemantics) {
            bagRole = fetchable.getNavigableRole().getNavigableName();
        } else {
            bagRole = null;
        }
        if (joined && previousBagRole != null && bagRole != null) {
            // Avoid join fetching multiple bags
            joined = false;
        }
        boolean changeFetchDepth = !(fetchable instanceof BasicValuedModelPart) && !(fetchable instanceof EmbeddedAttributeMapping) && !(fetchable instanceof CollectionPart);
        try {
            if (changeFetchDepth) {
                fetchDepth++;
            }
            // There is no need to check for circular fetches if this is an explicit fetch
            if (!explicitFetch && !creationState.isResolvingCircularFetch()) {
                final Fetch biDirectionalFetch = fetchable.resolveCircularFetch(fetchablePath, fetchParent, fetchTiming, creationState);
                if (biDirectionalFetch != null) {
                    fetches.add(biDirectionalFetch);
                    return;
                }
            }
            final Integer maximumFetchDepth = creationContext.getMaximumFetchDepth();
            if (maximumFetchDepth != null) {
                if (fetchDepth == maximumFetchDepth + 1) {
                    joined = false;
                } else if (fetchDepth > maximumFetchDepth + 1) {
                    if (!(fetchable instanceof BasicValuedModelPart) && !(fetchable instanceof EmbeddedAttributeMapping)) {
                        return;
                    }
                }
            }
            if (joined) {
                // For join fetches we remember the currentBagRole so that we can avoid multiple bag fetches
                if (bagRole != null) {
                    currentBagRole = bagRole;
                }
            } else {
                // For non-join fetches, we reset the currentBagRole and set it to the previous value in the finally block
                currentBagRole = null;
            }
            final Fetch fetch = fetchParent.generateFetchableFetch(fetchable, fetchablePath, fetchTiming, joined, null, creationState);
            if (fetch.getTiming() == FetchTiming.IMMEDIATE && isFetchablePluralAttributeMapping) {
                final PluralAttributeMapping pluralAttributeMapping = (PluralAttributeMapping) fetchable;
                if (joined) {
                    hasCollectionJoinFetches = true;
                    final TableGroup joinTableGroup = creationState.getFromClauseAccess().getTableGroup(fetchablePath);
                    applyFiltering(querySpec, joinTableGroup, pluralAttributeMapping, creationState);
                    applyOrdering(querySpec, fetchablePath, pluralAttributeMapping, creationState);
                }
            }
            fetches.add(fetch);
        } finally {
            if (changeFetchDepth) {
                fetchDepth--;
            }
            // otherwise we could run into a multiple bag fetch situation
            if (!joined) {
                currentBagRole = previousBagRole;
            }
            if (entityGraphTraversalState != null && traversalResult != null) {
                entityGraphTraversalState.backtrack(traversalResult);
            }
        }
    };
}
Also used : Arrays(java.util.Arrays) CollectionFetch(org.hibernate.sql.results.graph.collection.internal.CollectionFetch) CollectionDomainResult(org.hibernate.sql.results.graph.collection.internal.CollectionDomainResult) GraphSemantic(org.hibernate.graph.GraphSemantic) ResultsHelper.attributeName(org.hibernate.query.results.ResultsHelper.attributeName) TableGroupJoin(org.hibernate.sql.ast.tree.from.TableGroupJoin) CascadingAction(org.hibernate.engine.spi.CascadingAction) EntityValuedModelPart(org.hibernate.metamodel.mapping.EntityValuedModelPart) EntityResultImpl(org.hibernate.sql.results.graph.entity.internal.EntityResultImpl) SqlAstCreationContext(org.hibernate.sql.ast.spi.SqlAstCreationContext) BagSemantics(org.hibernate.collection.spi.BagSemantics) FetchableContainer(org.hibernate.sql.results.graph.FetchableContainer) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) ComparisonPredicate(org.hibernate.sql.ast.tree.predicate.ComparisonPredicate) BiDirectionalFetch(org.hibernate.sql.results.graph.BiDirectionalFetch) ForeignKeyDescriptor(org.hibernate.metamodel.mapping.ForeignKeyDescriptor) Map(java.util.Map) FetchProfile(org.hibernate.engine.profile.FetchProfile) JdbcParameterImpl(org.hibernate.sql.exec.internal.JdbcParameterImpl) ComparisonOperator(org.hibernate.query.sqm.ComparisonOperator) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) CollectionPart(org.hibernate.metamodel.mapping.CollectionPart) EntityValuedFetchable(org.hibernate.sql.results.graph.entity.EntityValuedFetchable) InSubQueryPredicate(org.hibernate.sql.ast.tree.predicate.InSubQueryPredicate) Fetchable(org.hibernate.sql.results.graph.Fetchable) TableGroupJoinProducer(org.hibernate.sql.ast.tree.from.TableGroupJoinProducer) LockOptions(org.hibernate.LockOptions) NavigablePath(org.hibernate.query.spi.NavigablePath) AliasCollector(org.hibernate.sql.ast.spi.AliasCollector) DomainResult(org.hibernate.sql.results.graph.DomainResult) Expression(org.hibernate.sql.ast.tree.expression.Expression) OrderByFragment(org.hibernate.metamodel.mapping.ordering.OrderByFragment) SimpleFromClauseAccessImpl(org.hibernate.sql.ast.spi.SimpleFromClauseAccessImpl) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) Objects(java.util.Objects) EntityIdentifierMapping(org.hibernate.metamodel.mapping.EntityIdentifierMapping) SelectStatement(org.hibernate.sql.ast.tree.select.SelectStatement) LoadQueryInfluencers(org.hibernate.engine.spi.LoadQueryInfluencers) List(java.util.List) CascadeStyle(org.hibernate.engine.spi.CascadeStyle) SqlTuple(org.hibernate.sql.ast.tree.expression.SqlTuple) QuerySpec(org.hibernate.sql.ast.tree.select.QuerySpec) SubselectFetch(org.hibernate.engine.spi.SubselectFetch) SimpleForeignKeyDescriptor(org.hibernate.metamodel.mapping.internal.SimpleForeignKeyDescriptor) EmbeddedAttributeMapping(org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping) SqlExpressionResolver.createColumnReferenceKey(org.hibernate.sql.ast.spi.SqlExpressionResolver.createColumnReferenceKey) FetchParent(org.hibernate.sql.results.graph.FetchParent) BasicValuedModelPart(org.hibernate.metamodel.mapping.BasicValuedModelPart) InListPredicate(org.hibernate.sql.ast.tree.predicate.InListPredicate) Logger(org.jboss.logging.Logger) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference) ArrayList(java.util.ArrayList) RootGraphImplementor(org.hibernate.graph.spi.RootGraphImplementor) TableReference(org.hibernate.sql.ast.tree.from.TableReference) ModelPart(org.hibernate.metamodel.mapping.ModelPart) Loader(org.hibernate.loader.ast.spi.Loader) BiConsumer(java.util.function.BiConsumer) EntityIdentifierNavigablePath(org.hibernate.query.sqm.spi.EntityIdentifierNavigablePath) SqlAliasBaseManager(org.hibernate.sql.ast.spi.SqlAliasBaseManager) SqlAstCreationState(org.hibernate.sql.ast.spi.SqlAstCreationState) FetchTiming(org.hibernate.engine.FetchTiming) Loadable(org.hibernate.loader.ast.spi.Loadable) Fetch(org.hibernate.sql.results.graph.Fetch) Consumer(java.util.function.Consumer) Restrictable(org.hibernate.metamodel.mapping.Restrictable) EntityGraphTraversalState(org.hibernate.sql.results.graph.EntityGraphTraversalState) FetchStyle(org.hibernate.engine.FetchStyle) StandardEntityGraphTraversalStateImpl(org.hibernate.sql.results.internal.StandardEntityGraphTraversalStateImpl) AbstractMap(java.util.AbstractMap) JdbcParameter(org.hibernate.sql.ast.tree.expression.JdbcParameter) FromClauseAccess(org.hibernate.sql.ast.spi.FromClauseAccess) QueryPart(org.hibernate.sql.ast.tree.select.QueryPart) SqlAstJoinType(org.hibernate.sql.ast.SqlAstJoinType) NaturalIdMapping(org.hibernate.metamodel.mapping.NaturalIdMapping) SqlSelectionImpl(org.hibernate.sql.results.internal.SqlSelectionImpl) NonAggregatedIdentifierMapping(org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping) AttributeMapping(org.hibernate.metamodel.mapping.AttributeMapping) Collections(java.util.Collections) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) EffectiveEntityGraph(org.hibernate.engine.spi.EffectiveEntityGraph) PluralTableGroup(org.hibernate.sql.ast.tree.from.PluralTableGroup) CascadeStyle(org.hibernate.engine.spi.CascadeStyle) CascadingAction(org.hibernate.engine.spi.CascadingAction) EntityValuedFetchable(org.hibernate.sql.results.graph.entity.EntityValuedFetchable) Fetchable(org.hibernate.sql.results.graph.Fetchable) NavigablePath(org.hibernate.query.spi.NavigablePath) EntityIdentifierNavigablePath(org.hibernate.query.sqm.spi.EntityIdentifierNavigablePath) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) CollectionFetch(org.hibernate.sql.results.graph.collection.internal.CollectionFetch) BiDirectionalFetch(org.hibernate.sql.results.graph.BiDirectionalFetch) SubselectFetch(org.hibernate.engine.spi.SubselectFetch) Fetch(org.hibernate.sql.results.graph.Fetch) EntityValuedModelPart(org.hibernate.metamodel.mapping.EntityValuedModelPart) EmbeddedAttributeMapping(org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping) BiDirectionalFetch(org.hibernate.sql.results.graph.BiDirectionalFetch) CollectionPart(org.hibernate.metamodel.mapping.CollectionPart) FetchProfile(org.hibernate.engine.profile.FetchProfile) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) PluralTableGroup(org.hibernate.sql.ast.tree.from.PluralTableGroup) BasicValuedModelPart(org.hibernate.metamodel.mapping.BasicValuedModelPart) FetchableContainer(org.hibernate.sql.results.graph.FetchableContainer) EntityValuedFetchable(org.hibernate.sql.results.graph.entity.EntityValuedFetchable) EntityIdentifierNavigablePath(org.hibernate.query.sqm.spi.EntityIdentifierNavigablePath) FetchTiming(org.hibernate.engine.FetchTiming) EntityIdentifierMapping(org.hibernate.metamodel.mapping.EntityIdentifierMapping) BagSemantics(org.hibernate.collection.spi.BagSemantics)

Example 30 with AttributeMapping

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

the class LoaderSelectBuilder method applySubSelectRestriction.

private void applySubSelectRestriction(QuerySpec querySpec, NavigablePath rootNavigablePath, TableGroup rootTableGroup, SubselectFetch subselect, LoaderSqlAstCreationState sqlAstCreationState) {
    final SqlAstCreationContext sqlAstCreationContext = sqlAstCreationState.getCreationContext();
    final SessionFactoryImplementor sessionFactory = sqlAstCreationContext.getSessionFactory();
    assert loadable instanceof PluralAttributeMapping;
    final PluralAttributeMapping attributeMapping = (PluralAttributeMapping) loadable;
    final ForeignKeyDescriptor fkDescriptor = attributeMapping.getKeyDescriptor();
    final NavigablePath navigablePath = rootNavigablePath.append(attributeMapping.getAttributeName());
    final Expression fkExpression;
    final int jdbcTypeCount = fkDescriptor.getJdbcTypeCount();
    if (jdbcTypeCount == 1) {
        assert fkDescriptor instanceof SimpleForeignKeyDescriptor;
        final SimpleForeignKeyDescriptor simpleFkDescriptor = (SimpleForeignKeyDescriptor) fkDescriptor;
        final TableReference tableReference = rootTableGroup.resolveTableReference(navigablePath, simpleFkDescriptor.getContainingTableExpression());
        fkExpression = sqlAstCreationState.getSqlExpressionResolver().resolveSqlExpression(createColumnReferenceKey(tableReference, simpleFkDescriptor.getSelectionExpression()), sqlAstProcessingState -> new ColumnReference(tableReference, simpleFkDescriptor.getSelectionExpression(), false, null, null, simpleFkDescriptor.getJdbcMapping(), this.creationContext.getSessionFactory()));
    } else {
        final List<ColumnReference> columnReferences = new ArrayList<>(jdbcTypeCount);
        fkDescriptor.forEachSelectable((columnIndex, selection) -> {
            final TableReference tableReference = rootTableGroup.resolveTableReference(navigablePath, selection.getContainingTableExpression());
            columnReferences.add((ColumnReference) sqlAstCreationState.getSqlExpressionResolver().resolveSqlExpression(createColumnReferenceKey(tableReference, selection.getSelectionExpression()), sqlAstProcessingState -> new ColumnReference(tableReference, selection, this.creationContext.getSessionFactory())));
        });
        fkExpression = new SqlTuple(columnReferences, fkDescriptor);
    }
    querySpec.applyPredicate(new InSubQueryPredicate(fkExpression, generateSubSelect(attributeMapping, rootTableGroup, subselect, jdbcTypeCount, sqlAstCreationState, sessionFactory), false));
}
Also used : Arrays(java.util.Arrays) CollectionFetch(org.hibernate.sql.results.graph.collection.internal.CollectionFetch) CollectionDomainResult(org.hibernate.sql.results.graph.collection.internal.CollectionDomainResult) GraphSemantic(org.hibernate.graph.GraphSemantic) ResultsHelper.attributeName(org.hibernate.query.results.ResultsHelper.attributeName) TableGroupJoin(org.hibernate.sql.ast.tree.from.TableGroupJoin) CascadingAction(org.hibernate.engine.spi.CascadingAction) EntityValuedModelPart(org.hibernate.metamodel.mapping.EntityValuedModelPart) EntityResultImpl(org.hibernate.sql.results.graph.entity.internal.EntityResultImpl) SqlAstCreationContext(org.hibernate.sql.ast.spi.SqlAstCreationContext) BagSemantics(org.hibernate.collection.spi.BagSemantics) FetchableContainer(org.hibernate.sql.results.graph.FetchableContainer) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) ComparisonPredicate(org.hibernate.sql.ast.tree.predicate.ComparisonPredicate) BiDirectionalFetch(org.hibernate.sql.results.graph.BiDirectionalFetch) ForeignKeyDescriptor(org.hibernate.metamodel.mapping.ForeignKeyDescriptor) Map(java.util.Map) FetchProfile(org.hibernate.engine.profile.FetchProfile) JdbcParameterImpl(org.hibernate.sql.exec.internal.JdbcParameterImpl) ComparisonOperator(org.hibernate.query.sqm.ComparisonOperator) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) CollectionPart(org.hibernate.metamodel.mapping.CollectionPart) EntityValuedFetchable(org.hibernate.sql.results.graph.entity.EntityValuedFetchable) InSubQueryPredicate(org.hibernate.sql.ast.tree.predicate.InSubQueryPredicate) Fetchable(org.hibernate.sql.results.graph.Fetchable) TableGroupJoinProducer(org.hibernate.sql.ast.tree.from.TableGroupJoinProducer) LockOptions(org.hibernate.LockOptions) NavigablePath(org.hibernate.query.spi.NavigablePath) AliasCollector(org.hibernate.sql.ast.spi.AliasCollector) DomainResult(org.hibernate.sql.results.graph.DomainResult) Expression(org.hibernate.sql.ast.tree.expression.Expression) OrderByFragment(org.hibernate.metamodel.mapping.ordering.OrderByFragment) SimpleFromClauseAccessImpl(org.hibernate.sql.ast.spi.SimpleFromClauseAccessImpl) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) Objects(java.util.Objects) EntityIdentifierMapping(org.hibernate.metamodel.mapping.EntityIdentifierMapping) SelectStatement(org.hibernate.sql.ast.tree.select.SelectStatement) LoadQueryInfluencers(org.hibernate.engine.spi.LoadQueryInfluencers) List(java.util.List) CascadeStyle(org.hibernate.engine.spi.CascadeStyle) SqlTuple(org.hibernate.sql.ast.tree.expression.SqlTuple) QuerySpec(org.hibernate.sql.ast.tree.select.QuerySpec) SubselectFetch(org.hibernate.engine.spi.SubselectFetch) SimpleForeignKeyDescriptor(org.hibernate.metamodel.mapping.internal.SimpleForeignKeyDescriptor) EmbeddedAttributeMapping(org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping) SqlExpressionResolver.createColumnReferenceKey(org.hibernate.sql.ast.spi.SqlExpressionResolver.createColumnReferenceKey) FetchParent(org.hibernate.sql.results.graph.FetchParent) BasicValuedModelPart(org.hibernate.metamodel.mapping.BasicValuedModelPart) InListPredicate(org.hibernate.sql.ast.tree.predicate.InListPredicate) Logger(org.jboss.logging.Logger) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference) ArrayList(java.util.ArrayList) RootGraphImplementor(org.hibernate.graph.spi.RootGraphImplementor) TableReference(org.hibernate.sql.ast.tree.from.TableReference) ModelPart(org.hibernate.metamodel.mapping.ModelPart) Loader(org.hibernate.loader.ast.spi.Loader) BiConsumer(java.util.function.BiConsumer) EntityIdentifierNavigablePath(org.hibernate.query.sqm.spi.EntityIdentifierNavigablePath) SqlAliasBaseManager(org.hibernate.sql.ast.spi.SqlAliasBaseManager) SqlAstCreationState(org.hibernate.sql.ast.spi.SqlAstCreationState) FetchTiming(org.hibernate.engine.FetchTiming) Loadable(org.hibernate.loader.ast.spi.Loadable) Fetch(org.hibernate.sql.results.graph.Fetch) Consumer(java.util.function.Consumer) Restrictable(org.hibernate.metamodel.mapping.Restrictable) EntityGraphTraversalState(org.hibernate.sql.results.graph.EntityGraphTraversalState) FetchStyle(org.hibernate.engine.FetchStyle) StandardEntityGraphTraversalStateImpl(org.hibernate.sql.results.internal.StandardEntityGraphTraversalStateImpl) AbstractMap(java.util.AbstractMap) JdbcParameter(org.hibernate.sql.ast.tree.expression.JdbcParameter) FromClauseAccess(org.hibernate.sql.ast.spi.FromClauseAccess) QueryPart(org.hibernate.sql.ast.tree.select.QueryPart) SqlAstJoinType(org.hibernate.sql.ast.SqlAstJoinType) NaturalIdMapping(org.hibernate.metamodel.mapping.NaturalIdMapping) SqlSelectionImpl(org.hibernate.sql.results.internal.SqlSelectionImpl) NonAggregatedIdentifierMapping(org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping) AttributeMapping(org.hibernate.metamodel.mapping.AttributeMapping) Collections(java.util.Collections) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) EffectiveEntityGraph(org.hibernate.engine.spi.EffectiveEntityGraph) PluralTableGroup(org.hibernate.sql.ast.tree.from.PluralTableGroup) NavigablePath(org.hibernate.query.spi.NavigablePath) EntityIdentifierNavigablePath(org.hibernate.query.sqm.spi.EntityIdentifierNavigablePath) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) InSubQueryPredicate(org.hibernate.sql.ast.tree.predicate.InSubQueryPredicate) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) ArrayList(java.util.ArrayList) TableReference(org.hibernate.sql.ast.tree.from.TableReference) SqlAstCreationContext(org.hibernate.sql.ast.spi.SqlAstCreationContext) Expression(org.hibernate.sql.ast.tree.expression.Expression) ForeignKeyDescriptor(org.hibernate.metamodel.mapping.ForeignKeyDescriptor) SimpleForeignKeyDescriptor(org.hibernate.metamodel.mapping.internal.SimpleForeignKeyDescriptor) SqlTuple(org.hibernate.sql.ast.tree.expression.SqlTuple) SimpleForeignKeyDescriptor(org.hibernate.metamodel.mapping.internal.SimpleForeignKeyDescriptor) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference)

Aggregations

AttributeMapping (org.hibernate.metamodel.mapping.AttributeMapping)56 PluralAttributeMapping (org.hibernate.metamodel.mapping.PluralAttributeMapping)38 SingularAttributeMapping (org.hibernate.metamodel.mapping.SingularAttributeMapping)20 EmbeddedAttributeMapping (org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping)19 ToOneAttributeMapping (org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping)19 EntityPersister (org.hibernate.persister.entity.EntityPersister)17 SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)13 EntityIdentifierMapping (org.hibernate.metamodel.mapping.EntityIdentifierMapping)12 DiscriminatedAssociationAttributeMapping (org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationAttributeMapping)12 EntityMappingType (org.hibernate.metamodel.mapping.EntityMappingType)10 Test (org.junit.jupiter.api.Test)9 ArrayList (java.util.ArrayList)8 EmbeddableMappingType (org.hibernate.metamodel.mapping.EmbeddableMappingType)8 ModelPart (org.hibernate.metamodel.mapping.ModelPart)7 Expression (org.hibernate.sql.ast.tree.expression.Expression)7 ForeignKeyDescriptor (org.hibernate.metamodel.mapping.ForeignKeyDescriptor)6 NonAggregatedIdentifierMapping (org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping)6 Fetchable (org.hibernate.sql.results.graph.Fetchable)6 CascadeStyle (org.hibernate.engine.spi.CascadeStyle)5 NavigablePath (org.hibernate.query.spi.NavigablePath)5