Class OneToManyPersister
java.lang.Object
org.hibernate.persister.collection.AbstractCollectionPersister
org.hibernate.persister.collection.OneToManyPersister
- All Implemented Interfaces:
CollectionMutationTarget, org.hibernate.engine.profile.internal.FetchProfileAffectee, FilterRestrictable, org.hibernate.metamodel.mapping.internal.InFlightCollectionMapping, org.hibernate.metamodel.mapping.internal.PluralAttributeMappingImpl.Aware, Restrictable, WhereRestrictable, CollectionPersister, Joinable, GraphMutationTarget<CollectionTableDescriptor>, LegacyMutationTarget<CollectionTableMapping>, MutationTarget<CollectionTableMapping, CollectionTableDescriptor>
- See Also:
-
Field Summary
Fields inherited from class AbstractCollectionPersister
batchSize, elementColumnAliases, elementColumnIsGettable, elementColumnIsSettable, elementColumnNames, elementColumnReaders, elementColumnReaderTemplates, elementColumnWriters, elementFormulas, elementFormulaTemplates, elementIsPureFormula, elementType, hasWhere, identifierColumnName, indexColumnAliases, indexColumnIsGettable, indexColumnIsSettable, indexColumnNames, indexContainsFormula, indexFormulas, indexFormulaTemplates, isInverse, keyColumnAliases, keyColumnNames, keyFormulas, keyFormulaTemplates, qualifiedTableName, sqlExceptionHelper, sqlWhereString -
Constructor Summary
ConstructorsConstructorDescriptionOneToManyPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState astCreationState) protected CollectionDecomposervoiddecompose(org.hibernate.action.internal.CollectionRecreateAction action, int ordinalBase, SharedSessionContractImplementor session, DecompositionContext decompositionContext, Consumer<FlushOperation> operationConsumer) Decomposes a collection recreate action into planned operations.voiddecompose(org.hibernate.action.internal.CollectionRemoveAction action, int ordinalBase, SharedSessionContractImplementor session, DecompositionContext decompositionContext, Consumer<FlushOperation> operationConsumer) Removes the collection: For collections with a collection-table, this will execute a DELETE based on the collection-key For one-to-many collections, this executes an UPDATE to unset the collection-key on the association tablevoiddecompose(org.hibernate.action.internal.CollectionUpdateAction action, int ordinalBase, SharedSessionContractImplementor session, DecompositionContext decompositionContext, Consumer<FlushOperation> operationConsumer) Decomposes a collection update action into planned operationsvoiddecompose(org.hibernate.action.internal.QueuedOperationCollectionAction action, int ordinalBase, SharedSessionContractImplementor session, Consumer<FlushOperation> operationConsumer) Decomposes a queued collection operation action into planned operations.voiddeleteRows(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session) Delete the persistent state of any elements that were removed from the collectionprotected voiddoProcessQueuedOps(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) generateDeleteAllAst(MutatingTableReference tableReference) generateDeleteRowAst(MutatingTableReference tableReference) getFilterAliasGenerator(String rootAlias) getFilterAliasGenerator(TableGroup rootTableGroup) voidinsertRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) Insert the persistent state of any new collection elementsbooleanbooleanIs this a many-to-many association? Note that this is mainly a convenience feature as the single persister does not contain all the information needed to handle a many-to-many itself, as internally it is looked at as two many-to-ones.booleanIs this a one-to-many association?booleanvoidvoidprepareMappingModel(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess creationProcess, Collection bootCollectionDescriptor) voidrecreate(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) (Re)create the collection's persistent statevoidupdateRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) Update the persistent state of any elements that were modifiedMethods inherited from class AbstractCollectionPersister
applyBaseManyToManyRestrictions, applyBaseRestrictions, applyFilterRestrictions, applyKeyRestrictions, applyWhereRestrictions, buildDeleteAllOperation, createNamedQueryCollectionLoader, createSingleKeyCollectionLoader, createSubSelectLoader, determineLoaderToUse, determineTableName, elementExists, forEachMutableTable, forEachMutableTableDescriptor, forEachMutableTableDescriptorReverse, forEachMutableTableReverse, generateDetectRowByElementString, generateDetectRowByIndexString, generateSelectSizeString, getAttributeMapping, getBatchSize, getCacheAccessStrategy, getCacheEntryStructure, getCollectionLoader, getCollectionPropertyColumnAliases, getCollectionSemantics, getCollectionSpaces, getCollectionTableDescriptor, getCollectionTableMapping, getCollectionType, getDialect, getElementByIndex, getElementClass, getElementColumnAliases, getElementColumnIsSettable, getElementColumnNames, getElementFormulas, getElementPersister, getElementPersisterInternal, getElementType, getFactory, getGenerator, getIdentifierColumnAlias, getIdentifierColumnName, getIdentifierTableName, getIdentifierType, getIndexColumnAliases, getIndexColumnIsSettable, getIndexColumnNames, getIndexFormulas, getIndexIncrementer, getIndexType, getKeyColumnAliases, getKeyColumnNames, getKeyFormulas, getKeyType, getMappedByProperty, getNavigableRole, getOwnerEntityName, getOwnerEntityPersister, getRolePath, getSize, getSortingComparator, getSQLExceptionHelper, getSqlWhereString, getTargetPart, hasCache, hasIndex, hasManyToManyOrdering, hasOrdering, hasOrphanDelete, hasPhysicalIndexColumn, hasWhereRestrictions, incrementIndexByBase, indexExists, initCollectionPropertyMap, initialize, injectAttributeMapping, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEnabledFilters, isAffectedByEnabledFilters, isAffectedByEnabledFilters, isAffectedByEntityGraph, isArray, isCascadeDeleteEnabled, isExtraLazy, isInverse, isLazy, isMutable, isPrimitiveArray, isRowInsertEnabled, isSubselectLoadable, isVersioned, logStaticSQL, needsRemove, processQueuedOps, registerAffectingFetchProfile, remove, selectFragment, toString, useShallowQueryCacheLayoutMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CollectionMutationTarget
getIdentifierTableDescriptor, getIdentifierTableMappingMethods inherited from interface CollectionPersister
getRole, isBatchLoadable
-
Constructor Details
-
OneToManyPersister
public OneToManyPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext) throws MappingException, CacheException - Throws:
MappingExceptionCacheException
-
-
Method Details
-
prepareMappingModel
public void prepareMappingModel(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess creationProcess, Collection bootCollectionDescriptor) - Specified by:
prepareMappingModelin interfaceorg.hibernate.metamodel.mapping.internal.InFlightCollectionMapping- Overrides:
prepareMappingModelin classAbstractCollectionPersister
-
postInstantiate
- Specified by:
postInstantiatein interfaceCollectionPersister- Overrides:
postInstantiatein classAbstractCollectionPersister- Throws:
MappingException
-
buildCollectionDecomposer
-
isDoWriteEvenWhenInverse
public boolean isDoWriteEvenWhenInverse() -
getRowMutationOperations
- Specified by:
getRowMutationOperationsin interfaceCollectionPersister- Specified by:
getRowMutationOperationsin classAbstractCollectionPersister
-
getInsertRowsCoordinator
-
getUpdateRowsCoordinator
-
getDeleteRowsCoordinator
-
getRemoveCoordinator
- Specified by:
getRemoveCoordinatorin classAbstractCollectionPersister
-
getWriteIndexCoordinator
-
isRowDeleteEnabled
public boolean isRowDeleteEnabled()- Specified by:
isRowDeleteEnabledin interfaceCollectionPersister- Overrides:
isRowDeleteEnabledin classAbstractCollectionPersister
-
isOneToMany
public boolean isOneToMany()Description copied from interface:CollectionPersisterIs this a one-to-many association? -
isManyToMany
public boolean isManyToMany()Description copied from interface:CollectionPersisterIs this a many-to-many association? Note that this is mainly a convenience feature as the single persister does not contain all the information needed to handle a many-to-many itself, as internally it is looked at as two many-to-ones.- Specified by:
isManyToManyin interfaceCollectionPersister- Specified by:
isManyToManyin classAbstractCollectionPersister
-
getTableName
- Specified by:
getTableNamein interfaceCollectionPersister- Overrides:
getTableNamein classAbstractCollectionPersister
-
applyWhereFragments
protected void applyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState astCreationState) - Overrides:
applyWhereFragmentsin classAbstractCollectionPersister
-
getFilterAliasGenerator
- Specified by:
getFilterAliasGeneratorin classAbstractCollectionPersister
-
getFilterAliasGenerator
- Specified by:
getFilterAliasGeneratorin classAbstractCollectionPersister
-
generateDeleteAllAst
public RestrictedTableMutation<JdbcMutationOperation> generateDeleteAllAst(MutatingTableReference tableReference) - Overrides:
generateDeleteAllAstin classAbstractCollectionPersister
-
generateDeleteRowAst
public RestrictedTableMutation<JdbcMutationOperation> generateDeleteRowAst(MutatingTableReference tableReference)
-