Class PluralAttributeMappingImpl
java.lang.Object
org.hibernate.metamodel.mapping.internal.AbstractAttributeMapping
org.hibernate.metamodel.mapping.internal.PluralAttributeMappingImpl
- All Implemented Interfaces:
FetchProfileAffectee,Loadable,AttributeMapping,Bindable,FilterRestrictable,JdbcMappingContainer,MappingModelExpressible,ModelPart,ModelPartContainer,OwnedValuedModelPart,PluralAttributeMapping,PropertyBasedMapping,Restrictable,SelectableMappings,SoftDeletableModelPart,ValuedModelPart,ValueMapping,WhereRestrictable,RootTableGroupProducer,TableGroupJoinProducer,TableGroupProducer,DatabaseSnapshotContributor,Fetchable,FetchableContainer,FetchOptions,FetchStyleAccess,FetchTimingAccess,JavaTypedExpressible,MutabilityPlanExposer
public class PluralAttributeMappingImpl
extends AbstractAttributeMapping
implements PluralAttributeMapping, FetchProfileAffectee, FetchOptions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAllows callback after creation of the attribute mapping.Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesBiConsumer<X,Y>, Bindable.JdbcValuesConsumer Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.PluralAttributeMapping
PluralAttributeMapping.IndexMetadata, PluralAttributeMapping.PredicateConsumer -
Constructor Summary
ConstructorsModifierConstructorDescriptionPluralAttributeMappingImpl(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) protectedFor Hibernate Reactive -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session) Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.voidapplySoftDeleteRestrictions(TableGroup tableGroup, PluralAttributeMapping.PredicateConsumer predicateConsumer) voidapplySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState) Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.voidapplySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer) Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.<X,Y> int breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session) Breaks down the domain value to its constituent JDBC values.protected FetchbuildDelayedCollectionFetch(NavigablePath fetchedPath, PluralAttributeMapping fetchedAttribute, FetchParent fetchParent, DomainResult<?> collectionKeyResult, boolean unfetched) For Hibernate Reactiveprotected FetchbuildEagerCollectionFetch(NavigablePath fetchedPath, PluralAttributeMapping fetchedAttribute, TableGroup collectionTableGroup, boolean needsCollectionKeyResult, FetchParent fetchParent, DomainResultCreationState creationState) For Hibernate Reactiveprotected FetchbuildSelectEagerCollectionFetch(NavigablePath fetchedPath, PluralAttributeMapping fetchedAttribute, DomainResult<?> collectionKeyDomainResult, FetchParent fetchParent) For Hibernate ReactivebooleancontainsTableReference(String tableExpression) <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState) Create a DomainResult for a specific reference to this ModelPart.createRootTableGroup(boolean canUseInnerJoins, NavigablePath navigablePath, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, Supplier<Consumer<Predicate>> additionalPredicateCollectorAccess, SqlAstCreationState creationState) Create a root TableGroup as defined by this producercreateRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType requestedJoinType, boolean fetched, @Nullable Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState) Create the "join", but return a TableGroup.createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState) Create a TableGroupJoin.determineSqlJoinType(TableGroup lhs, @Nullable SqlAstJoinType requestedJoinType, boolean fetched) disassemble(Object value, SharedSessionContractImplementor session) Breaks down a value ofJinto its simple pieces.findSubPart(String name, EntityMappingType treatTargetType) voidfinishInitialization(Property bootProperty, Collection bootDescriptor, MappingModelCreationProcess creationProcess) <X,Y> int forEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session) LikeBindable.forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), but additionally receives an offset by which the selectionIndex is incremented when callingBindable.JdbcValuesBiConsumer.consume(int, Object, Object, Object, JdbcMapping).intforEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action) Visit each JdbcMapping starting from the given offsetvoidforEachSubPart(IndexedConsumer<ModelPart> consumer, EntityMappingType treatTarget) generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState) Generates a Fetch of this fetchableintThe table which contains the columns mapped by this valuegetDefaultSqlAstJoinType(TableGroup parentTableGroup) The name of the fetchable.The value generation strategy to use for this attribute.getJdbcMapping(int index) intThe number of JDBC mappingsThe configured fetch timing and styleDescriptor for the type of this mappingThe name for this loadable, for use as the root when generating relative pathsgetSelectable(int columnIndex) Get the selectable at the given positionMapping for soft-delete support, ornullif soft-delete not definedDetails about the table which holds the soft-delete column.Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedgetStyle()booleanbooleanisAffectedByEnabledFetchProfiles(LoadQueryInfluencers influencers) Whether any of the LoadQueryInfluencers.getEnabledFetchProfileNames() apply to this loadablebooleanisAffectedByEnabledFilters(LoadQueryInfluencers influencers, boolean onlyApplyForLoadByKeyFilters) Whether any of the "influencers" affect this loadable.booleanisAffectedByEntityGraph(LoadQueryInfluencers influencers) Whether the effective entity-graph applies to this loadablebooleanisBidirectionalAttributeName(NavigablePath fetchablePath, ToOneAttributeMapping modelPart) booleanisSimpleJoinPredicate(Predicate predicate) Returns whether the given predicate is a simple join predicate for this attribute.voidregisterAffectingFetchProfile(String fetchProfileName) Register the profile name with the entity/collectionresolveCircularFetch(NavigablePath fetchablePath, FetchParent fetchParent, FetchTiming fetchTiming, DomainResultCreationState creationState) Check whether this Fetchable is considered a circular fetch.voidsetForeignKeyDescriptor(ForeignKeyDescriptor fkDescriptor) toString()voidvisitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType) Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractAttributeMapping
getAttributeMetadata, getAttributeName, getDeclaringType, getFetchableKey, getJavaType, getPartMappingType, getPropertyAccess, getStateArrayPositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.metamodel.mapping.AttributeMapping
asAttributeMapping, asEmbeddedAttributeMapping, compare, findContainingEntityMapping, getAttributeMetadata, getAttributeName, getDeclaringType, getExposedMutabilityPlan, getPartName, getPropertyAccess, getStateArrayPosition, getValue, isEmbeddedAttributeMapping, setValueMethods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, forEachJdbcValueMethods inherited from interface org.hibernate.sql.results.graph.Fetchable
getFetchableKey, isSelectableMethods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getSelectableIndex, visitFetchables, visitKeyFetchablesMethods inherited from interface org.hibernate.metamodel.mapping.FilterRestrictable
applyFilterRestrictionsMethods inherited from interface org.hibernate.loader.ast.spi.Loadable
isAffectedByEnabledFilters, isAffectedByInfluencers, isAffectedByInfluencers, isNotAffectedByInfluencersMethods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, decompose, decompose, getJavaType, getPartMappingType, isEntityIdentifierMapping, isVirtualMethods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPartMethods inherited from interface org.hibernate.metamodel.mapping.PluralAttributeMapping
applyBaseManyToManyRestrictions, applyBaseRestrictions, applyFilterRestrictions, applyWhereRestrictions, asPluralAttributeMapping, createSnapshotDomainResult, getFetchable, getKeyFetchable, getNumberOfFetchableKeys, getNumberOfFetchables, getNumberOfKeyFetchables, hasWhereRestrictions, incrementFetchDepth, isPluralAttributeMapping, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchablesMethods inherited from interface org.hibernate.metamodel.mapping.Restrictable
applyBaseRestrictionsMethods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachInsertable, forEachNonFormula, forEachSelectable, forEachSelectable, forEachUpdatable, getSingleJdbcMappingMethods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
Constructor Details
-
PluralAttributeMappingImpl
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) -
PluralAttributeMappingImpl
For Hibernate Reactive
-
-
Method Details
-
finishInitialization
public void finishInitialization(Property bootProperty, Collection bootDescriptor, MappingModelCreationProcess creationProcess) -
getMappedType
Description copied from interface:ValueMappingDescriptor for the type of this mapping- Specified by:
getMappedTypein interfacePluralAttributeMapping- Specified by:
getMappedTypein interfaceValueMapping
-
getKeyDescriptor
- Specified by:
getKeyDescriptorin interfacePluralAttributeMapping
-
getCollectionDescriptor
- Specified by:
getCollectionDescriptorin interfacePluralAttributeMapping
-
getElementDescriptor
- Specified by:
getElementDescriptorin interfacePluralAttributeMapping
-
getIndexDescriptor
- Specified by:
getIndexDescriptorin interfacePluralAttributeMapping
-
getIndexMetadata
- Specified by:
getIndexMetadatain interfacePluralAttributeMapping
-
getIdentifierDescriptor
- Specified by:
getIdentifierDescriptorin interfacePluralAttributeMapping
-
getSoftDeleteMapping
Description copied from interface:PluralAttributeMappingMapping for soft-delete support, ornullif soft-delete not defined- Specified by:
getSoftDeleteMappingin interfacePluralAttributeMapping- Specified by:
getSoftDeleteMappingin interfaceSoftDeletableModelPart
-
getSoftDeleteTableDetails
Description copied from interface:SoftDeletableModelPartDetails about the table which holds the soft-delete column.- Specified by:
getSoftDeleteTableDetailsin interfaceSoftDeletableModelPart
-
getOrderByFragment
- Specified by:
getOrderByFragmentin interfacePluralAttributeMapping
-
getManyToManyOrderByFragment
- Specified by:
getManyToManyOrderByFragmentin interfacePluralAttributeMapping
-
getSeparateCollectionTable
- Specified by:
getSeparateCollectionTablein interfacePluralAttributeMapping
-
containsTableReference
- Specified by:
containsTableReferencein interfaceTableGroupProducer
-
getGenerator
Description copied from interface:AttributeMappingThe value generation strategy to use for this attribute.- Specified by:
getGeneratorin interfaceAttributeMapping
-
getFetchableName
Description copied from interface:FetchableThe name of the fetchable. This is the part's "local name".- Specified by:
getFetchableNamein interfaceFetchable- See Also:
-
getMappedFetchOptions
Description copied from interface:FetchableThe configured fetch timing and style- Specified by:
getMappedFetchOptionsin interfaceFetchable
-
getStyle
- Specified by:
getStylein interfaceFetchStyleAccess
-
getTiming
- Specified by:
getTimingin interfaceFetchTimingAccess
-
hasPartitionedSelectionMapping
public boolean hasPartitionedSelectionMapping()- Specified by:
hasPartitionedSelectionMappingin interfaceModelPart
-
applySoftDeleteRestrictions
public void applySoftDeleteRestrictions(TableGroup tableGroup, PluralAttributeMapping.PredicateConsumer predicateConsumer) - Specified by:
applySoftDeleteRestrictionsin interfacePluralAttributeMapping
-
getSqlAliasStem
Description copied from interface:TableGroupProducerGet the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedNote that this is a metadata-ive value. It is only ever used internal to the producer producing its TableGroup.
- Specified by:
getSqlAliasStemin interfaceTableGroupProducer- See Also:
-
getDefaultSqlAstJoinType
- Specified by:
getDefaultSqlAstJoinTypein interfaceTableGroupJoinProducer
-
isSimpleJoinPredicate
Description copied from interface:TableGroupJoinProducerReturns whether the given predicate is a simple join predicate for this attribute. This is useful to understand if a predicate has additional conjunctions other than the FK related predicate.- Specified by:
isSimpleJoinPredicatein interfaceTableGroupJoinProducer
-
determineSqlJoinType
public SqlAstJoinType determineSqlJoinType(TableGroup lhs, @Nullable SqlAstJoinType requestedJoinType, boolean fetched) - Specified by:
determineSqlJoinTypein interfaceTableGroupJoinProducer
-
setForeignKeyDescriptor
-
getBatchSize
public int getBatchSize()- Specified by:
getBatchSizein interfaceLoadable
-
isAffectedByEnabledFilters
public boolean isAffectedByEnabledFilters(LoadQueryInfluencers influencers, boolean onlyApplyForLoadByKeyFilters) Description copied from interface:LoadableWhether any of the "influencers" affect this loadable.- Specified by:
isAffectedByEnabledFiltersin interfaceLoadable
-
isAffectedByEntityGraph
Description copied from interface:LoadableWhether the effective entity-graph applies to this loadable- Specified by:
isAffectedByEntityGraphin interfaceLoadable
-
registerAffectingFetchProfile
Description copied from interface:FetchProfileAffecteeRegister the profile name with the entity/collection- Specified by:
registerAffectingFetchProfilein interfaceFetchProfileAffectee
-
isAffectedByEnabledFetchProfiles
Description copied from interface:LoadableWhether any of the LoadQueryInfluencers.getEnabledFetchProfileNames() apply to this loadable- Specified by:
isAffectedByEnabledFetchProfilesin interfaceLoadable
-
getRootPathName
Description copied from interface:LoadableThe name for this loadable, for use as the root when generating relative paths- Specified by:
getRootPathNamein interfaceLoadable
-
findSubPart
- Specified by:
findSubPartin interfaceModelPartContainer
-
forEachSubPart
- Specified by:
forEachSubPartin interfaceModelPartContainer
-
visitSubParts
- Specified by:
visitSubPartsin interfaceModelPartContainer
-
getContainingTableExpression
Description copied from interface:ValuedModelPartThe table which contains the columns mapped by this value- Specified by:
getContainingTableExpressionin interfaceValuedModelPart
-
getJdbcTypeCount
public int getJdbcTypeCount()Description copied from interface:BindableThe number of JDBC mappings- Specified by:
getJdbcTypeCountin interfaceBindable- Specified by:
getJdbcTypeCountin interfaceJdbcMappingContainer- Specified by:
getJdbcTypeCountin interfaceSelectableMappings- Specified by:
getJdbcTypeCountin interfaceValuedModelPart
-
getJdbcMapping
- Specified by:
getJdbcMappingin interfaceJdbcMappingContainer
-
getSelectable
Description copied from interface:SelectableMappingsGet the selectable at the given position- Specified by:
getSelectablein interfaceSelectableMappings
-
forEachJdbcType
Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
toString