Class OneToManyPersister
- java.lang.Object
-
- org.hibernate.persister.collection.AbstractCollectionPersister
-
- org.hibernate.persister.collection.OneToManyPersister
-
- All Implemented Interfaces:
FetchProfileAffectee
,CollectionMetadata
,FilterRestrictable
,PluralAttributeMappingImpl.Aware
,Restrictable
,WhereRestrictable
,CollectionPersister
,DeprecatedCollectionStuff
,CollectionMutationTarget
,QueryableCollection
,SQLLoadableCollection
,Joinable
,PropertyMapping
,MutationTarget<CollectionTableMapping>
@Internal public class OneToManyPersister extends AbstractCollectionPersister
- See Also:
BasicCollectionPersister
-
-
Field Summary
-
Fields inherited from class org.hibernate.persister.collection.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, qualifiedTableName, sqlExceptionHelper, sqlWhereString
-
-
Constructor Summary
Constructors Constructor Description OneToManyPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext)
OneToManyPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState astCreationState)
boolean
consumesCollectionAlias()
Very, very, very ugly...boolean
consumesEntityAlias()
Very, very, very ugly...void
deleteRows(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)
Delete the persistent state of any elements that were removed from the collectionprotected void
doProcessQueuedOps(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)
RestrictedTableMutation<JdbcMutationOperation>
generateDeleteAllAst(MutatingTableReference tableReference)
RestrictedTableMutation<JdbcMutationOperation>
generateDeleteRowAst(MutatingTableReference tableReference)
protected DeleteRowsCoordinator
getDeleteRowsCoordinator()
FilterAliasGenerator
getFilterAliasGenerator(String rootAlias)
FilterAliasGenerator
getFilterAliasGenerator(TableGroup rootTableGroup)
protected InsertRowsCoordinator
getInsertRowsCoordinator()
protected RemoveCoordinator
getRemoveCoordinator()
protected RowMutationOperations
getRowMutationOperations()
String
getTableName()
The table to join to.protected UpdateRowsCoordinator
getUpdateRowsCoordinator()
void
insertRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)
Insert the persistent state of any new collection elementsboolean
isCascadeDeleteEnabled()
Is cascade delete handled by the database-level foreign key constraint definition?boolean
isManyToMany()
Is 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.boolean
isOneToMany()
Is this a one-to-many association?protected boolean
isRowDeleteEnabled()
protected boolean
isRowInsertEnabled()
void
recreate(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)
(Re)create the collection's persistent statevoid
updateRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)
Update the persistent state of any elements that were modified-
Methods inherited from class org.hibernate.persister.collection.AbstractCollectionPersister
applyBaseManyToManyRestrictions, applyBaseRestrictions, applyFilterRestrictions, applyKeyRestrictions, applyWhereRestrictions, buildDeleteAllOperation, createNamedQueryCollectionLoader, createSingleKeyCollectionLoader, createSubSelectLoader, decrementIndexByBase, determineLoaderToUse, determineTableName, elementExists, forEachMutableTable, forEachMutableTableReverse, generateDetectRowByElementString, generateDetectRowByIndexString, generateSelectSizeString, getAttributeMapping, getBatchSize, getCacheAccessStrategy, getCacheEntryStructure, getCollectionLoader, getCollectionMetadata, getCollectionPropertyColumnAliases, getCollectionSemantics, getCollectionSpaces, getCollectionTableMapping, getCollectionType, getDialect, getElementByIndex, getElementClass, getElementColumnAliases, getElementColumnNames, getElementColumnNames, getElementPersister, getElementPersisterInternal, getElementType, getFactory, getFetchMode, getGenerator, getIdentifierColumnAlias, getIdentifierColumnName, getIdentifierGenerator, getIdentifierTableName, getIdentifierType, getIndexColumnAliases, getIndexColumnNames, getIndexColumnNames, getIndexFormulas, getIndexType, getKeyColumnAliases, getKeyColumnNames, getKeyType, getManyToManyFilterFragment, getManyToManyOrderByString, getMappedByProperty, getName, getNavigableRole, getOwnerEntityName, getOwnerEntityPersister, getSize, getSortingComparator, getSQLExceptionHelper, getSQLOrderByString, getTargetPart, hasCache, hasIndex, hasManyToManyOrdering, hasOrdering, hasOrphanDelete, hasPhysicalIndexColumn, hasWhere, hasWhereRestrictions, incrementIndexByBase, indexExists, initCollectionPropertyMap, initialize, injectAttributeMapping, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEnabledFilters, isAffectedByEntityGraph, isArray, isBatchLoadable, isCollection, isExtraLazy, isInverse, isLazy, isMutable, isPrimitiveArray, isSubselectLoadable, isVersioned, logStaticSQL, needsRemove, postInstantiate, processQueuedOps, registerAffectingFetchProfile, remove, selectFragment, toColumns, toString, toType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.persister.collection.mutation.CollectionMutationTarget
getIdentifierTableMapping
-
Methods inherited from interface org.hibernate.persister.collection.DeprecatedCollectionStuff
getRole
-
Methods inherited from interface org.hibernate.sql.model.MutationTarget
getRolePath
-
-
-
-
Constructor Detail
-
OneToManyPersister
@Deprecated(since="6.0") public OneToManyPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext) throws MappingException, CacheException
Deprecated.- Throws:
MappingException
CacheException
-
OneToManyPersister
public OneToManyPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext) throws MappingException, CacheException
- Throws:
MappingException
CacheException
-
-
Method Detail
-
getRowMutationOperations
protected RowMutationOperations getRowMutationOperations()
- Specified by:
getRowMutationOperations
in classAbstractCollectionPersister
-
getInsertRowsCoordinator
protected InsertRowsCoordinator getInsertRowsCoordinator()
-
getUpdateRowsCoordinator
protected UpdateRowsCoordinator getUpdateRowsCoordinator()
-
getDeleteRowsCoordinator
protected DeleteRowsCoordinator getDeleteRowsCoordinator()
-
getRemoveCoordinator
protected RemoveCoordinator getRemoveCoordinator()
- Specified by:
getRemoveCoordinator
in classAbstractCollectionPersister
-
isRowDeleteEnabled
protected boolean isRowDeleteEnabled()
- Overrides:
isRowDeleteEnabled
in classAbstractCollectionPersister
-
isRowInsertEnabled
protected boolean isRowInsertEnabled()
- Overrides:
isRowInsertEnabled
in classAbstractCollectionPersister
-
isCascadeDeleteEnabled
public boolean isCascadeDeleteEnabled()
Description copied from interface:CollectionPersister
Is cascade delete handled by the database-level foreign key constraint definition?
-
recreate
public void recreate(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersister
(Re)create the collection's persistent state- Throws:
HibernateException
-
insertRows
public void insertRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersister
Insert the persistent state of any new collection elements- Throws:
HibernateException
-
updateRows
public void updateRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)
Description copied from interface:CollectionPersister
Update the persistent state of any elements that were modified
-
deleteRows
public void deleteRows(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)
Description copied from interface:CollectionPersister
Delete the persistent state of any elements that were removed from the collection
-
doProcessQueuedOps
protected void doProcessQueuedOps(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException
- Specified by:
doProcessQueuedOps
in classAbstractCollectionPersister
- Throws:
HibernateException
-
consumesEntityAlias
public boolean consumesEntityAlias()
Description copied from interface:Joinable
Very, very, very ugly...- Returns:
- Does this persister "consume" entity column aliases in the result set?
-
consumesCollectionAlias
public boolean consumesCollectionAlias()
Description copied from interface:Joinable
Very, very, very ugly...- Returns:
- Does this persister "consume" collection column aliases in the result set?
-
isOneToMany
public boolean isOneToMany()
Description copied from interface:CollectionPersister
Is this a one-to-many association?
-
isManyToMany
public boolean isManyToMany()
Description copied from interface:CollectionPersister
Is 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:
isManyToMany
in interfaceCollectionPersister
- Specified by:
isManyToMany
in classAbstractCollectionPersister
-
getTableName
public String getTableName()
Description copied from interface:Joinable
The table to join to.- Specified by:
getTableName
in interfaceJoinable
- Overrides:
getTableName
in classAbstractCollectionPersister
-
applyWhereFragments
protected void applyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState astCreationState)
- Overrides:
applyWhereFragments
in classAbstractCollectionPersister
-
getFilterAliasGenerator
public FilterAliasGenerator getFilterAliasGenerator(String rootAlias)
- Specified by:
getFilterAliasGenerator
in classAbstractCollectionPersister
-
getFilterAliasGenerator
public FilterAliasGenerator getFilterAliasGenerator(TableGroup rootTableGroup)
- Specified by:
getFilterAliasGenerator
in classAbstractCollectionPersister
-
generateDeleteAllAst
public RestrictedTableMutation<JdbcMutationOperation> generateDeleteAllAst(MutatingTableReference tableReference)
- Overrides:
generateDeleteAllAst
in classAbstractCollectionPersister
-
generateDeleteRowAst
public RestrictedTableMutation<JdbcMutationOperation> generateDeleteRowAst(MutatingTableReference tableReference)
-
-