Top Description Fields Constructors Methods
org.hibernate.persister.collection

public Class BasicCollectionPersister

extends AbstractCollectionPersister
Class Inheritance
Annotations
@Internal
Imports
java.util.Collections, .List, org.hibernate.HibernateException, .Internal, .MappingException, org.hibernate.cache.CacheException, org.hibernate.cache.spi.access.CollectionDataAccess, org.hibernate.collection.spi.PersistentCollection, org.hibernate.engine.jdbc.mutation.JdbcValueBindings, .ParameterUsage, org.hibernate.engine.jdbc.mutation.internal.MutationQueryOptions, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.internal.FilterAliasGenerator, .StaticFilterAliasGenerator, org.hibernate.internal.util.MutableInteger, org.hibernate.internal.util.collections.ArrayHelper, org.hibernate.mapping.Collection, org.hibernate.metamodel.mapping.CollectionIdentifierDescriptor, .CollectionPart, .ForeignKeyDescriptor, .PluralAttributeMapping, .SoftDeleteMapping, org.hibernate.metamodel.spi.RuntimeModelCreationContext, org.hibernate.persister.collection.mutation.DeleteRowsCoordinator, .DeleteRowsCoordinatorNoOp, .DeleteRowsCoordinatorStandard, .InsertRowsCoordinator, .InsertRowsCoordinatorNoOp, .InsertRowsCoordinatorStandard, .OperationProducer, .RemoveCoordinator, .RemoveCoordinatorNoOp, .RemoveCoordinatorStandard, .RowMutationOperations, .UpdateRowsCoordinator, .UpdateRowsCoordinatorNoOp, .UpdateRowsCoordinatorStandard, org.hibernate.persister.spi.PersisterCreationContext, org.hibernate.sql.ast.SqlAstTranslator, org.hibernate.sql.ast.tree.expression.ColumnReference, org.hibernate.sql.ast.tree.from.TableGroup, org.hibernate.sql.model.ast.ColumnValueBinding, .ColumnValueParameterList, .ColumnWriteFragment, .MutatingTableReference, .RestrictedTableMutation, .TableInsert, .TableMutation, org.hibernate.sql.model.ast.builder.CollectionRowDeleteBuilder, .TableInsertBuilderStandard, .TableUpdateBuilderStandard, org.hibernate.sql.model.internal.TableUpdateStandard, org.hibernate.sql.model.jdbc.JdbcMutationOperation

Deprecated

as a consequence of AbstractCollectionPersister being deprecated. See corresponding docs for further information.

A CollectionPersister for collections of values and many-to-many associations.
Author
Gavin King
See Also
OneToManyPersister

Field Summary

Modifier and TypeField and Description
private final DeleteRowsCoordinator
private final InsertRowsCoordinator
private final RemoveCoordinator
private final RowMutationOperations
private final UpdateRowsCoordinator
Inherited from org.hibernate.persister.collection.AbstractCollectionPersister:
batchSizeelementColumnAliaseselementColumnIsGettableelementColumnIsSettableelementColumnNameselementColumnReaderselementColumnReaderTemplateselementColumnWriterselementFormulaselementFormulaTemplateselementIsPureFormulaelementTypehasWhereidentifierColumnNameindexColumnAliasesindexColumnIsGettableindexColumnIsSettableindexColumnNamesindexContainsFormulaindexFormulasindexFormulaTemplatesisInversekeyColumnAliaseskeyColumnNamesqualifiedTableNamesqlExceptionHelpersqlWhereString

Constructor Summary

AccessConstructor and Description
public
BasicCollectionPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext)

Deprecated since 6.0.
public
BasicCollectionPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext)

Deprecated as a consequence of RuntimeModelCreationContext being deprecated.

Method Summary

Modifier and TypeMethod and Description
private void
applyDeleteRowRestrictions(PersistentCollection<?> collection, Object keyValue, Object rowValue, int rowPosition, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings)

private void
private void
applyInsertRowValues(PersistentCollection<?> collection, Object key, Object rowValue, int rowPosition, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings)

private void
applyUpdateRowRestrictions(PersistentCollection<?> collection, Object key, Object entry, int entryPosition, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings)

private void
applyUpdateRowValues(PersistentCollection<?> collection, Object key, Object entry, int entryPosition, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings)

private JdbcMutationOperation
private RemoveCoordinator
private DeleteRowsCoordinator
private JdbcMutationOperation
private InsertRowsCoordinator
protected RowMutationOperations
private UpdateRowsCoordinator
public boolean
public boolean
public void
deleteRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.deleteRows.

Delete the persistent state of any elements that were removed from the collection
protected void
public RestrictedTableMutation<JdbcMutationOperation>
private RestrictedTableMutation<JdbcMutationOperation>
private JdbcMutationOperation
private TableMutation<JdbcMutationOperation>
private JdbcMutationOperation
protected RestrictedTableMutation<JdbcMutationOperation>
private RestrictedTableMutation<JdbcMutationOperation>
private JdbcMutationOperation
protected InsertRowsCoordinator
public FilterAliasGenerator
public FilterAliasGenerator
protected RemoveCoordinator
protected DeleteRowsCoordinator
protected RowMutationOperations
protected UpdateRowsCoordinator
public void
insertRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.insertRows.

Insert the persistent state of any new collection elements
public boolean
isCascadeDeleteEnabled()

Implements org.hibernate.persister.collection.CollectionPersister.isCascadeDeleteEnabled.

Is cascade delete handled by the database-level foreign key constraint definition?
public boolean
public boolean
public void
recreate(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.recreate.

(Re)create the collection's persistent state
public void
updateRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.updateRows.

Update the persistent state of any elements that were modified
Inherited from org.hibernate.persister.collection.AbstractCollectionPersister:
applyBaseManyToManyRestrictionsapplyBaseRestrictionsapplyFilterRestrictionsapplyKeyRestrictionsapplyWhereFragmentsapplyWhereRestrictionsbuildDeleteAllOperationcreateNamedQueryCollectionLoadercreateSingleKeyCollectionLoadercreateSubSelectLoaderdecrementIndexByBasedetermineLoaderToUsedetermineTableNameelementExistsforEachMutableTableforEachMutableTableReversegenerateDetectRowByElementStringgenerateDetectRowByIndexStringgenerateSelectSizeStringgetAttributeMappinggetBatchSizegetCacheAccessStrategygetCacheEntryStructuregetCollectionLoadergetCollectionMetadatagetCollectionPropertyColumnAliasesgetCollectionSemanticsgetCollectionSpacesgetCollectionTableMappinggetCollectionTypegetDialectgetElementByIndexgetElementClassgetElementColumnAliasesgetElementColumnNamesgetElementColumnNamesgetElementPersistergetElementPersisterInternalgetElementTypegetFactorygetFetchModegetGeneratorgetIdentifierColumnAliasgetIdentifierColumnNamegetIdentifierGeneratorgetIdentifierTableNamegetIdentifierTypegetIndexColumnAliasesgetIndexColumnNamesgetIndexColumnNamesgetIndexFormulasgetIndexTypegetKeyColumnAliasesgetKeyColumnNamesgetKeyTypegetManyToManyFilterFragmentgetManyToManyOrderByStringgetMappedByPropertygetNamegetNavigableRolegetOwnerEntityNamegetOwnerEntityPersistergetSizegetSortingComparatorgetSQLExceptionHelpergetSQLOrderByStringgetTableNamegetTargetParthasCachehasIndexhasManyToManyOrderinghasOrderinghasOrphanDeletehasPhysicalIndexColumnhasWherehasWhereRestrictionsincrementIndexByBaseindexExistsinitCollectionPropertyMapinitializeinjectAttributeMappingisAffectedByEnabledFetchProfilesisAffectedByEnabledFiltersisAffectedByEnabledFiltersisAffectedByEntityGraphisArrayisBatchLoadableisCollectionisExtraLazyisInverseisLazyisMutableisPrimitiveArrayisRowDeleteEnabledisRowInsertEnabledisSubselectLoadableisVersionedlogStaticSQLneedsRemovepostInstantiateprocessQueuedOpsregisterAffectingFetchProfileremoveselectFragmenttoColumnstoStringtoType

Field Detail

deleteRowsCoordinatorback to summary
private final DeleteRowsCoordinator deleteRowsCoordinator
insertRowsCoordinatorback to summary
private final InsertRowsCoordinator insertRowsCoordinator
removeCoordinatorback to summary
private final RemoveCoordinator removeCoordinator
rowMutationOperationsback to summary
private final RowMutationOperations rowMutationOperations
updateCoordinatorback to summary
private final UpdateRowsCoordinator updateCoordinator

Constructor Detail

BasicCollectionPersisterback to summary
public BasicCollectionPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext) throws MappingException, CacheException

Deprecated

since 6.0.

Annotations
@Deprecated
since:6.0
BasicCollectionPersisterback to summary
public BasicCollectionPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext) throws MappingException, CacheException

Deprecated

as a consequence of RuntimeModelCreationContext being deprecated. See corresponding docs for further information.

Method Detail

applyDeleteRowRestrictionsback to summary
private void applyDeleteRowRestrictions(PersistentCollection<?> collection, Object keyValue, Object rowValue, int rowPosition, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings)
applyInsertDetailsback to summary
private void applyInsertDetails(TableInsertBuilderStandard insertBuilder)
applyInsertRowValuesback to summary
private void applyInsertRowValues(PersistentCollection<?> collection, Object key, Object rowValue, int rowPosition, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings)
applyUpdateRowRestrictionsback to summary
private void applyUpdateRowRestrictions(PersistentCollection<?> collection, Object key, Object entry, int entryPosition, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings)
applyUpdateRowValuesback to summary
private void applyUpdateRowValues(PersistentCollection<?> collection, Object key, Object entry, int entryPosition, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings)
buildCustomSqlInsertRowOperationback to summary
private JdbcMutationOperation buildCustomSqlInsertRowOperation(MutatingTableReference tableReference)
buildDeleteAllCoordinatorback to summary
private RemoveCoordinator buildDeleteAllCoordinator()
buildDeleteRowCoordinatorback to summary
private DeleteRowsCoordinator buildDeleteRowCoordinator()
buildGeneratedInsertRowOperationback to summary
private JdbcMutationOperation buildGeneratedInsertRowOperation(MutatingTableReference tableReference)
buildInsertRowCoordinatorback to summary
private InsertRowsCoordinator buildInsertRowCoordinator()
buildRowMutationOperationsback to summary
protected RowMutationOperations buildRowMutationOperations()
buildUpdateRowCoordinatorback to summary
private UpdateRowsCoordinator buildUpdateRowCoordinator()
consumesCollectionAliasback to summary
public boolean consumesCollectionAlias()

Implements org.hibernate.persister.entity.Joinable.consumesCollectionAlias.

Doc from org.hibernate.persister.entity.Joinable.consumesCollectionAlias.

Very, very, very ugly...

Returns:boolean

Does this persister "consume" collection column aliases in the result set?

Annotations
@Override
consumesEntityAliasback to summary
public boolean consumesEntityAlias()

Implements org.hibernate.persister.entity.Joinable.consumesEntityAlias.

Doc from org.hibernate.persister.entity.Joinable.consumesEntityAlias.

Very, very, very ugly...

Returns:boolean

Does this persister "consume" entity column aliases in the result set?

Annotations
@Override
deleteRowsback to summary
public void deleteRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.deleteRows.

Doc from org.hibernate.persister.collection.CollectionPersister.deleteRows.

Delete the persistent state of any elements that were removed from the collection

Annotations
@Override
doProcessQueuedOpsback to summary
protected void doProcessQueuedOps(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.doProcessQueuedOps.

Annotations
@Override
generateDeleteAllAstback to summary
public RestrictedTableMutation<JdbcMutationOperation> generateDeleteAllAst(MutatingTableReference tableReference)

Overrides org.hibernate.persister.collection.AbstractCollectionPersister.generateDeleteAllAst.

Annotations
@Override
generateDeleteRowAstback to summary
private RestrictedTableMutation<JdbcMutationOperation> generateDeleteRowAst(MutatingTableReference tableReference)
generateDeleteRowOperationback to summary
private JdbcMutationOperation generateDeleteRowOperation(MutatingTableReference tableReference)
generateInsertRowAstback to summary
private TableMutation<JdbcMutationOperation> generateInsertRowAst(MutatingTableReference tableReference)
generateInsertRowOperationback to summary
private JdbcMutationOperation generateInsertRowOperation(MutatingTableReference tableReference)
generateSoftDeleteRowsAstback to summary
protected RestrictedTableMutation<JdbcMutationOperation> generateSoftDeleteRowsAst(MutatingTableReference tableReference)
generateUpdateRowAstback to summary
private RestrictedTableMutation<JdbcMutationOperation> generateUpdateRowAst(MutatingTableReference tableReference)
generateUpdateRowOperationback to summary
private JdbcMutationOperation generateUpdateRowOperation(MutatingTableReference tableReference)
getCreateEntryCoordinatorback to summary
protected InsertRowsCoordinator getCreateEntryCoordinator()
getFilterAliasGeneratorback to summary
public FilterAliasGenerator getFilterAliasGenerator(String rootAlias)

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.getFilterAliasGenerator.

Annotations
@Override
getFilterAliasGeneratorback to summary
public FilterAliasGenerator getFilterAliasGenerator(TableGroup tableGroup)

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.getFilterAliasGenerator.

Annotations
@Override
getRemoveCoordinatorback to summary
protected RemoveCoordinator getRemoveCoordinator()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.getRemoveCoordinator.

Annotations
@Override
getRemoveEntryCoordinatorback to summary
protected DeleteRowsCoordinator getRemoveEntryCoordinator()
getRowMutationOperationsback to summary
protected RowMutationOperations getRowMutationOperations()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.getRowMutationOperations.

getUpdateEntryCoordinatorback to summary
protected UpdateRowsCoordinator getUpdateEntryCoordinator()
insertRowsback to summary
public void insertRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException

Implements org.hibernate.persister.collection.CollectionPersister.insertRows.

Doc from org.hibernate.persister.collection.CollectionPersister.insertRows.

Insert the persistent state of any new collection elements

Annotations
@Override
isCascadeDeleteEnabledback to summary
public boolean isCascadeDeleteEnabled()

Implements org.hibernate.persister.collection.CollectionPersister.isCascadeDeleteEnabled.

Doc from org.hibernate.persister.collection.CollectionPersister.isCascadeDeleteEnabled.

Is cascade delete handled by the database-level foreign key constraint definition?

isManyToManyback to summary
public boolean isManyToMany()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.isManyToMany.

Implements org.hibernate.persister.collection.CollectionPersister.isManyToMany.

Doc from org.hibernate.persister.collection.CollectionPersister.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.

Annotations
@Override
isOneToManyback to summary
public boolean isOneToMany()

Implements org.hibernate.persister.collection.CollectionPersister.isOneToMany.

Doc from org.hibernate.persister.collection.CollectionPersister.isOneToMany.

Is this a one-to-many association?

Annotations
@Override
recreateback to summary
public void recreate(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.recreate.

Doc from org.hibernate.persister.collection.CollectionPersister.recreate.

(Re)create the collection's persistent state

Annotations
@Override
updateRowsback to summary
public void updateRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.updateRows.

Doc from org.hibernate.persister.collection.CollectionPersister.updateRows.

Update the persistent state of any elements that were modified

Annotations
@Override