Top Inners Fields Constructors Methods
org.hibernate.metamodel.mapping.internal

public Class PluralAttributeMappingImpl

extends AbstractAttributeMapping
implements PluralAttributeMapping, FetchProfileAffectee, FetchOptions
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.results.graph.FetchOptions, org.hibernate.sql.results.graph.FetchStyleAccess, org.hibernate.sql.results.graph.FetchTimingAccess, org.hibernate.engine.profile.internal.FetchProfileAffectee, org.hibernate.metamodel.mapping.PluralAttributeMapping, org.hibernate.metamodel.mapping.SoftDeletableModelPart, org.hibernate.metamodel.mapping.ModelPartContainer, org.hibernate.metamodel.mapping.ModelPart, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.metamodel.mapping.Bindable, org.hibernate.metamodel.mapping.JdbcMappingContainer, org.hibernate.metamodel.mapping.Restrictable, org.hibernate.metamodel.mapping.WhereRestrictable, org.hibernate.metamodel.mapping.FilterRestrictable, org.hibernate.loader.ast.spi.Loadable, org.hibernate.sql.ast.tree.from.RootTableGroupProducer, org.hibernate.sql.ast.tree.from.TableGroupProducer, org.hibernate.sql.results.graph.FetchableContainer, org.hibernate.sql.ast.tree.from.TableGroupJoinProducer, org.hibernate.metamodel.mapping.AttributeMapping, org.hibernate.type.descriptor.java.MutabilityPlanExposer, org.hibernate.metamodel.mapping.PropertyBasedMapping, org.hibernate.sql.results.graph.DatabaseSnapshotContributor, org.hibernate.sql.results.graph.Fetchable, org.hibernate.metamodel.mapping.OwnedValuedModelPart, org.hibernate.metamodel.mapping.ValuedModelPart, org.hibernate.metamodel.mapping.SelectableMappings, org.hibernate.metamodel.mapping.ValueMapping, org.hibernate.type.descriptor.java.JavaTypedExpressible
Imports
java.util.function.BiConsumer, .Consumer, .Supplier, org.hibernate.boot.model.internal.SoftDeleteHelper, org.hibernate.cache.MutableCacheKeyBuilder, org.hibernate.engine.FetchStyle, .FetchTiming, org.hibernate.engine.profile.internal.FetchProfileAffectee, org.hibernate.engine.spi.CascadeStyle, .LoadQueryInfluencers, .SharedSessionContractImplementor, org.hibernate.generator.Generator, org.hibernate.internal.util.IndexedConsumer, .StringHelper, org.hibernate.mapping.Collection, .List, .Map, .Property, org.hibernate.metamodel.mapping.AttributeMetadata, .CollectionIdentifierDescriptor, .CollectionMappingType, .CollectionPart, .EntityMappingType, .ForeignKeyDescriptor, .JdbcMapping, .ManagedMappingType, .ModelPart, .ModelPartContainer, .PluralAttributeMapping, .SelectableMapping, .SoftDeleteMapping, .TableDetails, org.hibernate.metamodel.mapping.ordering.OrderByFragment, .OrderByFragmentTranslator, .TranslationContext, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.collection.mutation.CollectionMutationTarget, org.hibernate.persister.entity.Joinable, org.hibernate.property.access.spi.PropertyAccess, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.SqlAstJoinType, org.hibernate.sql.ast.spi.FromClauseAccess, .SqlAliasBase, .SqlAliasStemHelper, .SqlAstCreationState, .SqlSelection, org.hibernate.sql.ast.tree.from.CollectionTableGroup, .NamedTableReference, .OneToManyTableGroup, .TableGroup, .TableGroupJoin, .TableGroupJoinProducer, .TableReference, org.hibernate.sql.ast.tree.predicate.Predicate, .PredicateCollector, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, .Fetch, .FetchOptions, .FetchParent, org.hibernate.sql.results.graph.collection.internal.CollectionDomainResult, .DelayedCollectionFetch, .EagerCollectionFetch, .SelectEagerCollectionFetch, org.jboss.logging.Logger

Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
PluralAttributeMappingImpl.Aware

Allows callback after creation of the attribute mapping.

Field Summary

Modifier and TypeField and Description
private final AttributeMetadata
private final String
private final CollectionPersister
private final CollectionMappingType<C>
private final CollectionPart
private final FetchStyle
private final FetchTiming
private ForeignKeyDescriptor
private Boolean
private final CollectionIdentifierDescriptor
private final CollectionPart
private final PluralAttributeMapping.IndexMetadata
private static final Logger
private OrderByFragment
private final String
private OrderByFragment
private final PropertyAccess
private final String
private final String
private final SoftDeleteMapping
private final String
private final int

Constructor Summary

AccessConstructor and Description
public
PluralAttributeMappingImpl(String attributeName, Collection bootDescriptor, PropertyAccess propertyAccess, AttributeMetadata attributeMetadata, CollectionMappingType<?> collectionMappingType, int stateArrayPosition, int fetchableIndex, CollectionPart elementDescriptor, CollectionPart indexDescriptor, CollectionIdentifierDescriptor identifierDescriptor, FetchTiming fetchTiming, FetchStyle fetchStyle, CascadeStyle cascadeStyle, ManagedMappingType declaringType, CollectionPersister collectionDescriptor, MappingModelCreationProcess creationProcess)

protected

Method Summary

Modifier and TypeMethod and Description
public void
addToCacheKey(MutableCacheKeyBuilder
the MutableCacheKey used to add the disassembled value and the hashCode
cacheKey
,
Object
the value to disassemble
value
,
SharedSessionContractImplementor
the SharedSessionContractImplementor
session
)

Implements org.hibernate.metamodel.mapping.Bindable.addToCacheKey, org.hibernate.type.descriptor.java.JavaTypedExpressible.addToCacheKey.

Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.
private void
applySoftDeleteRestriction(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, SqlAstCreationState creationState)

public void
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.
public <X, Y> int
breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.ModelPart.breakDownJdbcValues.

Breaks down the domain value to its constituent JDBC values.
protected Fetch
buildDelayedCollectionFetch(NavigablePath fetchedPath, PluralAttributeMapping fetchedAttribute, FetchParent fetchParent, DomainResult<?> collectionKeyResult)

For Hibernate Reactive

protected Fetch
buildEagerCollectionFetch(NavigablePath fetchedPath, PluralAttributeMapping fetchedAttribute, TableGroup collectionTableGroup, FetchParent fetchParent, DomainResultCreationState creationState)

For Hibernate Reactive

protected Fetch
buildSelectEagerCollectionFetch(NavigablePath fetchedPath, PluralAttributeMapping fetchedAttribute, DomainResult<?> collectionKeyDomainResult, FetchParent fetchParent)

For Hibernate Reactive

public boolean
private TableGroup
createCollectionTableGroup(boolean canUseInnerJoins, SqlAstJoinType joinType, NavigablePath navigablePath, boolean fetched, boolean addsPredicate, String sourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstCreationState creationState)

private Fetch
createDelayedCollectionFetch(FetchParent fetchParent, NavigablePath fetchablePath, DomainResultCreationState creationState, SqlAstCreationState sqlAstCreationState)

public <T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Create a DomainResult for a specific reference to this ModelPart.
private TableGroup
createOneToManyTableGroup(boolean canUseInnerJoins, NavigablePath navigablePath, boolean fetched, String sourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstCreationState creationState)

public TableGroup
createRootTableGroup(boolean
Whether inner joins can be used when creating table-references within this group
canUseInnerJoins
,
NavigablePath
The overall NavigablePath for the root
navigablePath
,
String
The alias, if one, explicitly provided by the application for this root
explicitSourceAlias
,
SqlAliasBase
A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState
explicitSqlAliasBase
,
Supplier<Consumer<Predicate>>
Collector for additional predicates associated with this producer
additionalPredicateCollectorAccess
,
SqlAstCreationState
The creation state
creationState
)

Implements org.hibernate.sql.ast.tree.from.RootTableGroupProducer.createRootTableGroup.

Create a root TableGroup as defined by this producer
public TableGroup
createRootTableGroupJoin(NavigablePath
The NavigablePath to the join
navigablePath
,
TableGroup
The join's (L)eft-(H)and (S)ide
lhs
,
String explicitSourceAlias, SqlAliasBase
A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState
explicitSqlAliasBase
,
SqlAstJoinType
An explicit join-type. May be null to signal that the join is for an implicit path.
requestedJoinType
,
boolean fetched, Consumer<Predicate>
Consumer for additional predicates from the producer's mapping.
predicateConsumer
,
SqlAstCreationState creationState)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createRootTableGroupJoin.

Create the "join", but return a TableGroup.
private TableGroup
createRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState)

private Fetch
createSelectEagerCollectionFetch(FetchParent fetchParent, NavigablePath fetchablePath, DomainResultCreationState creationState, SqlAstCreationState sqlAstCreationState)

public TableGroupJoin
createTableGroupJoin(NavigablePath
The NavigablePath to the join
navigablePath
,
TableGroup
The join's (L)eft-(H)and (S)ide
lhs
,
String explicitSourceAlias, SqlAliasBase
A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState
explicitSqlAliasBase
,
SqlAstJoinType
An explicit join-type. May be null to signal that the join is for an implicit path.
requestedJoinType
,
boolean fetched, boolean
Indicates there are explicit, additional predicates (from an SQM tree ON/WITH clause)
addsPredicate
,
SqlAstCreationState creationState)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createTableGroupJoin.

Create a TableGroupJoin.
public SqlAstJoinType
public Object
disassemble(Object value, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.Bindable.disassemble.

Breaks down a value of J into its simple pieces.
public ModelPart
public void
finishInitialization(Property bootProperty, Collection bootDescriptor, MappingModelCreationProcess creationProcess)

public <X, Y> int
public int
forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)

Implements org.hibernate.metamodel.mapping.JdbcMappingContainer.forEachJdbcType.

Visit each JdbcMapping starting from the given offset
public void
public Fetch
generateFetch(FetchParent
The parent of the Fetch we are generating
fetchParent
,
NavigablePath
The overall path within the graph
fetchablePath
,
FetchTiming
The requested fetch timing
fetchTiming
,
boolean selected, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.sql.results.graph.Fetchable.generateFetch.

Generates a Fetch of this fetchable
public AttributeMetadata
public int
public CollectionPersister
public String
getContainingTableExpression()

Implements org.hibernate.metamodel.mapping.ValuedModelPart.getContainingTableExpression.

The table which contains the columns mapped by this value
public SqlAstJoinType
public CollectionPart
public String
public Generator
getGenerator()

Implements org.hibernate.metamodel.mapping.AttributeMapping.getGenerator.

The value generation strategy to use for this attribute.
public CollectionIdentifierDescriptor
public CollectionPart
public PluralAttributeMapping.IndexMetadata
public JdbcMapping
public int
public ForeignKeyDescriptor
public OrderByFragment
public FetchOptions
public CollectionMappingType<C>
public NavigableRole
public OrderByFragment
public PropertyAccess
getPropertyAccess()

Implements org.hibernate.metamodel.mapping.AttributeMapping.getPropertyAccess.

The getter/setter access to this attribute
public String
getRootPathName()

Implements org.hibernate.loader.ast.spi.Loadable.getRootPathName.

The name for this loadable, for use as the root when generating relative paths
public SelectableMapping
getSelectable(int columnIndex)

Implements org.hibernate.metamodel.mapping.SelectableMappings.getSelectable.

Get the selectable at the given position
public String
public SoftDeleteMapping
getSoftDeleteMapping()

Overrides default org.hibernate.metamodel.mapping.PluralAttributeMapping.getSoftDeleteMapping.

Mapping for soft-delete support, or null if soft-delete not defined
public TableDetails
public String
getSqlAliasStem()

Implements org.hibernate.sql.ast.tree.from.TableGroupProducer.getSqlAliasStem.

Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generated

Note that this is a metadata-ive value.

public int
getStateArrayPosition()

Implements org.hibernate.metamodel.mapping.AttributeMapping.getStateArrayPosition.

The attribute's position within the container's state array
public FetchStyle
public FetchTiming
public boolean
private boolean
private static void
injectAttributeMapping(CollectionPart elementDescriptor, CollectionPart indexDescriptor, CollectionPersister collectionDescriptor, PluralAttributeMapping mapping)

public boolean
public boolean
isAffectedByEnabledFilters(LoadQueryInfluencers influencers)

Implements org.hibernate.loader.ast.spi.Loadable.isAffectedByEnabledFilters.

Whether any of the "influencers" affect this loadable.
public boolean
public boolean
public boolean
isSimpleJoinPredicate(Predicate predicate)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.isSimpleJoinPredicate.

Returns whether the given predicate is a simple join predicate for this attribute.
public void
registerAffectingFetchProfile(String fetchProfileName)

Implements org.hibernate.engine.profile.internal.FetchProfileAffectee.registerAffectingFetchProfile.

Register the profile name with the entity/collection
public Fetch
resolveCircularFetch(NavigablePath
The overall path within the graph
fetchablePath
,
FetchParent fetchParent, FetchTiming fetchTiming, DomainResultCreationState creationState)

Overrides default org.hibernate.sql.results.graph.Fetchable.resolveCircularFetch.

Check whether this Fetchable is considered a circular fetch.
private TableGroup
resolveCollectionTableGroup(FetchParent fetchParent, NavigablePath fetchablePath, DomainResultCreationState creationState, SqlAstCreationState sqlAstCreationState)

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
Inherited from org.hibernate.metamodel.mapping.internal.AbstractAttributeMapping:
getAttributeNamegetDeclaringTypegetFetchableKeygetJavaTypegetPartMappingType