Class ManyToManyCollectionPart
java.lang.Object
org.hibernate.metamodel.mapping.internal.AbstractEntityCollectionPart
org.hibernate.metamodel.mapping.internal.ManyToManyCollectionPart
- All Implemented Interfaces:
Association
,Bindable
,CollectionPart
,EntityAssociationMapping
,EntityValuedModelPart
,EntityCollectionPart
,JdbcMappingContainer
,MappingModelExpressible
,ModelPart
,ModelPartContainer
,SelectableMappings
,ValuedModelPart
,ValueMapping
,LazyTableGroup.ParentTableGroupUseChecker
,TableGroupJoinProducer
,TableGroupProducer
,EntityValuedFetchable
,Fetchable
,FetchableContainer
,FetchOptions
,FetchStyleAccess
,FetchTimingAccess
,JavaTypedExpressible
public class ManyToManyCollectionPart
extends AbstractEntityCollectionPart
implements EntityAssociationMapping, LazyTableGroup.ParentTableGroupUseChecker
Entity-valued collection-part mapped through a join table. Models both
ManyToMany
mappingsOneToMany
withJoinTable
mappings
-
Nested Class Summary
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.CollectionPart
CollectionPart.Nature
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.internal.EntityCollectionPart
EntityCollectionPart.Cardinality
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,
Y>, ModelPart.JdbcValueConsumer -
Field Summary
Fields inherited from class org.hibernate.metamodel.mapping.internal.AbstractEntityCollectionPart
targetKeyPropertyNames
-
Constructor Summary
ConstructorDescriptionManyToManyCollectionPart
(CollectionPart.Nature nature, Collection collectionBootDescriptor, CollectionPersister collectionDescriptor, EntityMappingType associatedEntityDescriptor, NotFoundAction notFoundAction, MappingModelCreationProcess creationProcess) ManyToManyCollectionPart
(CollectionPart.Nature nature, Collection collectionBootDescriptor, CollectionPersister collectionDescriptor, EntityMappingType associatedEntityDescriptor, MappingModelCreationProcess creationProcess) -
Method Summary
Modifier and TypeMethodDescription<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.boolean
canUseParentTableGroup
(TableGroupProducer producer, NavigablePath navigablePath, ValuedModelPart valuedModelPart) createRootTableGroupJoin
(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType requestedJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState) Create the "join", but return a TableGroup.createTableGroupJoin
(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState) Create a TableGroupJoin.<X,
Y> int decompose
(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session) Similar toModelPart.breakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor)
, but this method is supposed to be used for decomposing values for assignment expressions.findSubPart
(String name, EntityMappingType targetType) boolean
finishInitialization
(CollectionPersister collectionDescriptor, Collection bootCollectionDescriptor, String fkTargetModelPartName, MappingModelCreationProcess creationProcess) Perform any delayed initialization.void
forEachInsertable
(SelectableConsumer consumer) int
forEachSelectable
(int offset, SelectableConsumer consumer) Visits each selectable mapping with the selectable index offset by the given value.void
forEachUpdatable
(SelectableConsumer consumer) The table which contains the columns mapped by this valuegetDefaultSqlAstJoinType
(TableGroup parentTableGroup) The descriptor, allowing access to column(s), etcgetJdbcMapping
(int index) The model sub-part relative to the associated entity type that is the target of this association's foreign-keygetSelectable
(int columnIndex) Get the selectable at the given positionIndicates which "side" of the foreign-key this association describesboolean
boolean
boolean
boolean
isSimpleJoinPredicate
(Predicate predicate) Returns whether the given predicate is a simple join predicate for this attribute.protected AssociationKey
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractEntityCollectionPart
buildEagerCollectionFetch, buildEntityFetchJoined, containsTableReference, createDomainResult, createTableGroupInternal, disassemble, findContainingEntityMapping, generateFetch, getAssociatedEntityMappingType, getCollectionAttribute, getCollectionDescriptor, getFetchableKey, getFetchableName, getMappedFetchOptions, getMappedType, getNature, getNavigableRole, getNotFoundAction, getNumberOfFetchables, getSqlAliasStem, getStyle, getTiming, incrementFetchDepth, isOptional, isUnwrapProxy, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
Methods inherited from interface org.hibernate.metamodel.mapping.CollectionPart
getPartName
Methods inherited from interface org.hibernate.metamodel.mapping.EntityAssociationMapping
getAssociatedEntityMappingType, getFetchableName, incrementFetchDepth
Methods inherited from interface org.hibernate.metamodel.mapping.internal.EntityCollectionPart
addToCacheKey, getEntityMappingType, getExpressibleJavaType, getJavaType, getJdbcTypeCount, getPartMappingType
Methods inherited from interface org.hibernate.metamodel.mapping.EntityValuedModelPart
applySqlSelections, applySqlSelections, findSubPart, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachSubPart, visitSubParts
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
asAttributeMapping, getFetchableKey, getMappedFetchOptions, isSelectable, resolveCircularFetch
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getFetchable, getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, getSelectableIndex, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, decompose, findContainingEntityMapping, getNavigableRole, isEntityIdentifierMapping, isVirtual
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupJoinProducer
determineSqlJoinType
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReference, getSqlAliasStem
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachNonFormula, forEachSelectable, getSingleJdbcMapping
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
treatAs
-
Constructor Details
-
ManyToManyCollectionPart
public ManyToManyCollectionPart(CollectionPart.Nature nature, Collection collectionBootDescriptor, CollectionPersister collectionDescriptor, EntityMappingType associatedEntityDescriptor, MappingModelCreationProcess creationProcess) -
ManyToManyCollectionPart
public ManyToManyCollectionPart(CollectionPart.Nature nature, Collection collectionBootDescriptor, CollectionPersister collectionDescriptor, EntityMappingType associatedEntityDescriptor, NotFoundAction notFoundAction, MappingModelCreationProcess creationProcess)
-
-
Method Details
-
getCardinality
- Specified by:
getCardinality
in interfaceEntityCollectionPart
-
getInclusionCheckPart
- Specified by:
getInclusionCheckPart
in interfaceCollectionPart
-
resolveFetchAssociationKey
- Specified by:
resolveFetchAssociationKey
in classAbstractEntityCollectionPart
-
findSubPart
- Specified by:
findSubPart
in interfaceEntityValuedModelPart
- Specified by:
findSubPart
in interfaceModelPartContainer
-
getTargetKeyPropertyNames
- Specified by:
getTargetKeyPropertyNames
in interfaceEntityAssociationMapping
-
getSelectable
Description copied from interface:SelectableMappings
Get the selectable at the given position- Specified by:
getSelectable
in interfaceSelectableMappings
-
getContainingTableExpression
Description copied from interface:ValuedModelPart
The table which contains the columns mapped by this value- Specified by:
getContainingTableExpression
in interfaceValuedModelPart
-
forEachSelectable
Description copied from interface:ModelPart
Visits each selectable mapping with the selectable index offset by the given value. Returns the amount of jdbc types that have been visited.- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- Specified by:
forEachSelectable
in interfaceValuedModelPart
- See Also:
-
forEachInsertable
- Specified by:
forEachInsertable
in interfaceValuedModelPart
-
forEachUpdatable
- Specified by:
forEachUpdatable
in interfaceValuedModelPart
-
getForeignKeyDescriptor
Description copied from interface:Association
The descriptor, allowing access to column(s), etc- Specified by:
getForeignKeyDescriptor
in interfaceAssociation
-
getSideNature
Description copied from interface:Association
Indicates which "side" of the foreign-key this association describes- Specified by:
getSideNature
in interfaceAssociation
-
getDefaultSqlAstJoinType
- Specified by:
getDefaultSqlAstJoinType
in interfaceTableGroupJoinProducer
-
isSimpleJoinPredicate
Description copied from interface:TableGroupJoinProducer
Returns 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:
isSimpleJoinPredicate
in interfaceTableGroupJoinProducer
-
isReferenceToPrimaryKey
public boolean isReferenceToPrimaryKey()- Specified by:
isReferenceToPrimaryKey
in interfaceEntityAssociationMapping
-
isFkOptimizationAllowed
public boolean isFkOptimizationAllowed()- Specified by:
isFkOptimizationAllowed
in interfaceEntityAssociationMapping
-
getKeyTargetMatchPart
Description copied from interface:EntityAssociationMapping
The model sub-part relative to the associated entity type that is the target of this association's foreign-key- Specified by:
getKeyTargetMatchPart
in interfaceEntityAssociationMapping
-
hasPartitionedSelectionMapping
public boolean hasPartitionedSelectionMapping()- Specified by:
hasPartitionedSelectionMapping
in interfaceModelPart
-
finishInitialization
public boolean finishInitialization(CollectionPersister collectionDescriptor, Collection bootCollectionDescriptor, String fkTargetModelPartName, MappingModelCreationProcess creationProcess) Description copied from interface:EntityCollectionPart
Perform any delayed initialization.The initialization is considered successful if the result is
true
. It is considered unsuccessful if the result isfalse
or an exception is thrown. Unsuccessful initializations are generally retried "later", to allow waiting for model-parts being available e.g.If the exception is something that will just never succeed, consider throwing an exception with the
NonTransientException
marker to allow the creation process to stop immediately- Specified by:
finishInitialization
in interfaceEntityCollectionPart
-
getJdbcMapping
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
-