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

public abstract Class AbstractCollectionPersister

extends Object
implements CollectionPersister, CollectionMutationTarget, Aware, FetchProfileAffectee, DeprecatedCollectionStuff
Class Inheritance
All Implemented Interfaces
org.hibernate.persister.collection.DeprecatedCollectionStuff, org.hibernate.metadata.CollectionMetadata, org.hibernate.persister.collection.SQLLoadableCollection, org.hibernate.persister.collection.QueryableCollection, org.hibernate.persister.collection.CollectionPersister, org.hibernate.metamodel.mapping.Restrictable, org.hibernate.metamodel.mapping.WhereRestrictable, org.hibernate.metamodel.mapping.FilterRestrictable, org.hibernate.persister.entity.Joinable, org.hibernate.persister.entity.PropertyMapping, org.hibernate.engine.profile.internal.FetchProfileAffectee, org.hibernate.metamodel.mapping.internal.PluralAttributeMappingImpl.Aware, org.hibernate.persister.collection.mutation.CollectionMutationTarget, org.hibernate.sql.model.MutationTarget
Known Direct Subclasses
org.hibernate.persister.collection.BasicCollectionPersister, org.hibernate.persister.collection.OneToManyPersister
Annotations
@Internal
Imports
java.sql.PreparedStatement, .ResultSet, .SQLException, java.util.Collections, .Comparator, .HashMap, .HashSet, .Iterator, .Map, .Set, java.util.function.Consumer, org.hibernate.AssertionFailure, .FetchMode, .Filter, .HibernateException, .Internal, .LockOptions, .MappingException, .QueryException, .Remove, .TransientObjectException, org.hibernate.boot.spi.MetadataImplementor, org.hibernate.cache.CacheException, org.hibernate.cache.spi.access.CollectionDataAccess, org.hibernate.cache.spi.entry.CacheEntryStructure, .StructuredCollectionCacheEntry, .StructuredMapCacheEntry, .UnstructuredCacheEntry, org.hibernate.collection.spi.CollectionSemantics, .PersistentCollection, org.hibernate.dialect.Dialect, org.hibernate.engine.jdbc.mutation.ParameterUsage, org.hibernate.engine.jdbc.mutation.internal.MutationQueryOptions, org.hibernate.engine.jdbc.spi.JdbcCoordinator, .SqlExceptionHelper, org.hibernate.engine.profile.internal.FetchProfileAffectee, org.hibernate.engine.spi.ExecuteUpdateResultCheckStyle, .LoadQueryInfluencers, .PersistenceContext, .SessionFactoryImplementor, .SharedSessionContractImplementor, .SubselectFetch, org.hibernate.generator.BeforeExecutionGenerator, .Generator, org.hibernate.id.IdentifierGenerator, org.hibernate.internal.FilterAliasGenerator, .FilterHelper, org.hibernate.internal.util.StringHelper, org.hibernate.jdbc.Expectation, .Expectations, org.hibernate.loader.ast.internal.CollectionElementLoaderByIndex, .CollectionLoaderNamedQuery, .CollectionLoaderSingleKey, .CollectionLoaderSubSelectFetch, .LoaderSqlAstCreationState, org.hibernate.loader.ast.spi.BatchLoaderFactory, .CollectionLoader, org.hibernate.mapping.Collection, .Column, .Formula, .IdentifierCollection, .IndexedCollection, .Selectable, .Table, .Value, org.hibernate.metadata.CollectionMetadata, org.hibernate.metamodel.CollectionClassification, org.hibernate.metamodel.mapping.EmbeddableValuedModelPart, .ForeignKeyDescriptor, .PluralAttributeMapping, org.hibernate.metamodel.mapping.internal.MappingModelCreationHelper, .PluralAttributeMappingImpl, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.metamodel.spi.RuntimeModelCreationContext, org.hibernate.persister.collection.mutation.CollectionMutationTarget, .CollectionTableMapping, .RemoveCoordinator, .RowMutationOperations, org.hibernate.persister.entity.AbstractEntityPersister, .EntityPersister, .Joinable, .PropertyMapping, org.hibernate.persister.internal.SqlFragmentPredicate, org.hibernate.persister.spi.PersisterCreationContext, org.hibernate.pretty.MessageHelper, org.hibernate.query.named.NamedQueryMemento, org.hibernate.query.spi.QueryOptions, org.hibernate.spi.NavigablePath, org.hibernate.sql.Alias, .SimpleSelect, .Template, org.hibernate.sql.ast.SqlAstTranslator, org.hibernate.sql.ast.spi.SimpleFromClauseAccessImpl, .SqlAliasBaseConstant, .SqlAliasBaseManager, .SqlAstCreationState, .SqlSelection, org.hibernate.sql.ast.tree.expression.AliasedExpression, .ColumnReference, org.hibernate.sql.ast.tree.from.TableGroup, .TableReference, org.hibernate.sql.ast.tree.predicate.Predicate, org.hibernate.sql.ast.tree.select.QuerySpec, .SelectClause, .SelectStatement, org.hibernate.sql.model.ModelMutationLogging, .MutationType, .TableMapping, .TableMapping.MutationDetails, org.hibernate.sql.model.ast.ColumnValueBinding, .ColumnValueParameter, .ColumnValueParameterList, .ColumnWriteFragment, .MutatingTableReference, .RestrictedTableMutation, org.hibernate.sql.model.internal.TableDeleteStandard, org.hibernate.sql.model.jdbc.JdbcDeleteMutation, .JdbcMutationOperation, org.hibernate.sql.results.graph.internal.ImmutableFetchList, org.hibernate.sql.results.internal.SqlSelectionImpl, org.hibernate.type.CollectionType, .CompositeType, .EntityType, .Type

Deprecated

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

Base implementation of the QueryableCollection interface.
Author
Gavin King
See Also
BasicCollectionPersister, OneToManyPersister

Field Summary

Modifier and TypeField and Description
private volatile Set<String>
private PluralAttributeMapping
protected final int
private final CollectionDataAccess
private final CacheEntryStructure
private CollectionElementLoaderByIndex
private CollectionLoader
private final Map<String, String[]>
private final CollectionSemantics<?, ?>
private final CollectionType
collectionType

Deprecated
private final Comparator<?>
private final Dialect
private final Class<?>
protected final String[]
protected final boolean[]
protected final boolean[]
protected final String[]
protected final String[]
protected final String[]
protected final String[]
protected final String[]
protected final String[]
protected final boolean
private final EntityPersister
private final PropertyMapping
elementPropertyMapping

Deprecated as a consequence of PropertyMapping being deprecated.
protected final Type
elementType

Deprecated
private final SessionFactoryImplementor
factory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
private final FetchMode
private final FilterHelper
private final boolean
private final boolean
private final boolean
protected final boolean
private final String
protected final String
private final BeforeExecutionGenerator
private final Type
identifierType

Deprecated
protected final String[]
indexColumnAliases

Deprecated
protected final boolean[]
protected final boolean[]
protected final String[]
protected final boolean
protected final String[]
protected final String[]
private String[]
private final Type
indexType

Deprecated
private final boolean
protected final boolean
private final boolean
private final boolean
private final boolean
private final boolean
protected final String[]
keyColumnAliases

Deprecated
protected final String[]
private final Type
keyType

Deprecated
private final FilterHelper
private final String
private final String
private final String
private final EntityPersister
protected final String
private final String
private final String[]
private final String
private final String
protected final SqlExceptionHelper
private final String
protected final String
private final String
private final boolean
private final CollectionTableMapping

Constructor Summary

AccessConstructor and Description
public
AbstractCollectionPersister(Collection collectionBootDescriptor, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext)

Deprecated since 6.0.
public
AbstractCollectionPersister(Collection collectionBootDescriptor, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext)

Deprecated as a consequence of RuntimeModelCreationContext being deprecated.

Method Summary

Modifier and TypeMethod and Description
public void
applyBaseManyToManyRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String, Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)

Implements org.hibernate.persister.collection.CollectionPersister.applyBaseManyToManyRestrictions.

public void
applyBaseRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String, Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)

Implements org.hibernate.metamodel.mapping.Restrictable.applyBaseRestrictions.

Applies the base set of restrictions.
public void
applyFilterRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String, Filter> enabledFilters, SqlAstCreationState creationState)

Implements org.hibernate.metamodel.mapping.FilterRestrictable.applyFilterRestrictions.

Applies just the org.hibernate.annotations.Filter values enabled for the associated entity
protected void
protected void
applyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState astCreationState)

private static void
applyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, String template)

Applies all defined org.hibernate.annotations.Where

public void
private static CollectionTableMapping
buildCollectionTableMapping(Collection collectionBootDescriptor, String qualifiedTableName, String[] spaces)

private JdbcDeleteMutation
protected JdbcMutationOperation
private JdbcMutationOperation
private BeforeExecutionGenerator
createGenerator(RuntimeModelCreationContext context, IdentifierCollection collection)

Deprecated as a consequence of RuntimeModelCreationContext being deprecated.
private CollectionLoader
protected CollectionLoader
createNamedQueryCollectionLoader(CollectionPersister persister, NamedQueryMemento namedQueryMemento)

For Hibernate Reactive

protected CollectionLoader
createSingleKeyCollectionLoader(LoadQueryInfluencers loadQueryInfluencers)

For Hibernate Reactive

protected CollectionLoader
protected @Remove Object
decrementIndexByBase(Object index)

Deprecated for removal. No longer used.
private static Expectation
determineExpectation(ExecuteUpdateResultCheckStyle explicitStyle, String customSql, boolean customSqlCallable, Expectation fallback)

private static Expectation
determineExpectation(ExecuteUpdateResultCheckStyle explicitStyle, String customSql, boolean customSqlCallable)

protected CollectionLoader
protected String
protected abstract void
public boolean
private boolean
exists(Object key, Object indexOrElement, Type indexOrElementType, String sql, SharedSessionContractImplementor session)

public void
public void
public RestrictedTableMutation<JdbcMutationOperation>
protected String
protected String
protected String
generateSelectSizeString(boolean isIntegerIndexed)

public PluralAttributeMapping
public int
public CollectionDataAccess
public CacheEntryStructure
getCacheEntryStructure()

Implements org.hibernate.persister.collection.CollectionPersister.getCacheEntryStructure.

Get the structure used to store data into the collection's cache region
public CollectionLoader
public CollectionMetadata
getCollectionMetadata()

Implements org.hibernate.persister.collection.CollectionPersister.getCollectionMetadata.

Deprecated
Get the user-visible metadata for the collection (optional operation)
public String[]
public CollectionSemantics<?, ?>
public String[]
getCollectionSpaces()

Implements org.hibernate.persister.collection.CollectionPersister.getCollectionSpaces.

Get the "space" that holds the persistent state
public CollectionTableMapping
public CollectionType
protected Dialect
public Object
public Class<?>
getElementClass()

Implements org.hibernate.persister.collection.CollectionPersister.getElementClass.

Return the element class of an array, or null otherwise.
public String[]
getElementColumnAliases(String
The suffix to use in the element column alias generation.
suffix
)

Implements org.hibernate.persister.collection.CollectionPersister.getElementColumnAliases.

Generates the collection's element column aliases, based on the given suffix.
public String[]
getElementColumnNames(String alias)

Implements org.hibernate.persister.collection.QueryableCollection.getElementColumnNames.

Get the names of the collection element columns (or the primary key columns in the case of a one-to-many association), aliased by the given table alias
public String[]
getElementColumnNames()

Implements org.hibernate.persister.collection.QueryableCollection.getElementColumnNames.

Get the names of the collection element columns (or the primary key columns in the case of a one-to-many association)
public EntityPersister
getElementPersister()

Implements org.hibernate.persister.collection.QueryableCollection.getElementPersister.

Get the persister of the element class, if this is a collection of entities (optional operation).
protected EntityPersister
public Type
public SessionFactoryImplementor
public FetchMode
getFetchMode()

Implements org.hibernate.persister.collection.QueryableCollection.getFetchMode.

Should we load this collection role by outerjoining?
public abstract FilterAliasGenerator
public abstract FilterAliasGenerator
public BeforeExecutionGenerator
getGenerator()

Overrides default org.hibernate.persister.collection.CollectionPersister.getGenerator.

Get the surrogate key generation strategy (optional operation)
public String
getIdentifierColumnAlias(String
The suffix to use in the key column alias generation.
suffix
)

Implements org.hibernate.persister.collection.CollectionPersister.getIdentifierColumnAlias.

Generates the collection's identifier column aliases, based on the given suffix.
public String
public IdentifierGenerator
getIdentifierGenerator()

Implements org.hibernate.persister.collection.CollectionPersister.getIdentifierGenerator.

Deprecated
Get the surrogate key generation strategy (optional operation)
public String
getIdentifierTableName()

Implements org.hibernate.sql.model.MutationTarget.getIdentifierTableName.

The name of the table defining the identifier for this target
public Type
public String[]
getIndexColumnAliases(String
The suffix to use in the index column alias generation.
suffix
)

Implements org.hibernate.persister.collection.CollectionPersister.getIndexColumnAliases.

Generates the collection's index column aliases, based on the given suffix.
public String[]
getIndexColumnNames()

Implements org.hibernate.persister.collection.QueryableCollection.getIndexColumnNames.

Get the names of the collection index columns if this is an indexed collection (optional operation)
public String[]
getIndexColumnNames(String alias)

Implements org.hibernate.persister.collection.QueryableCollection.getIndexColumnNames.

Get the names of the collection index columns if this is an indexed collection (optional operation), aliased by the given table alias
public String[]
getIndexFormulas()

Implements org.hibernate.persister.collection.QueryableCollection.getIndexFormulas.

Get the index formulas if this is an indexed collection (optional operation)
public Type
public String[]
getKeyColumnAliases(String
The suffix to use in the key column alias generation.
suffix
)

Implements org.hibernate.persister.collection.CollectionPersister.getKeyColumnAliases.

Generates the collection's key column aliases, based on the given suffix.
public String[]
public Type
public String
public String
getManyToManyOrderByString(String
The alias for the many-to-many target table
alias
)

Implements org.hibernate.persister.collection.QueryableCollection.getManyToManyOrderByString.

Get the order-by to be applied at the target table of a many to many
public String
public String
getName()

Implements org.hibernate.persister.entity.Joinable.getName.

An identifying name; a class name or collection role name.
private NamedQueryMemento
getNamedQueryMemento(MetadataImplementor bootModel)

Deprecated as a consequence of MetadataImplementor being deprecated.
public NavigableRole
public String
public EntityPersister
getOwnerEntityPersister()

Implements org.hibernate.persister.collection.CollectionPersister.getOwnerEntityPersister.

Get the persister of the entity that "owns" this collection
protected abstract RemoveCoordinator
protected abstract RowMutationOperations
public int
public Comparator<?>
protected SqlExceptionHelper
public String
public String
public PluralAttributeMapping
public boolean
hasCache()

Implements org.hibernate.persister.collection.CollectionPersister.hasCache.

Is this collection role cacheable
public boolean
public boolean
private boolean
public boolean
public boolean
hasOrphanDelete()

Implements org.hibernate.persister.collection.CollectionPersister.hasOrphanDelete.

Does this collection implement "orphan delete"?
public boolean
hasPhysicalIndexColumn()

Implements org.hibernate.persister.collection.mutation.CollectionMutationTarget.hasPhysicalIndexColumn.

Whether the collection has at least one physical index column
public boolean
hasWhere()

Implements org.hibernate.persister.collection.QueryableCollection.hasWhere.

Does this collection role have a where clause filter?
public boolean
hasWhereRestrictions()

Implements org.hibernate.metamodel.mapping.WhereRestrictable.hasWhereRestrictions.

Does this restrictable have a where restriction?
protected Object
public boolean
public void
private void
initCollectionPropertyMap(String aliasName, Type type, String[] columnAliases)

public void
initialize(Object key, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.initialize.

Initialize the given collection with the given key
public void
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
isCollection()

Implements org.hibernate.persister.entity.Joinable.isCollection.

Is this instance actually a CollectionPersister?
public boolean
public boolean
isInverse()

Implements org.hibernate.persister.collection.CollectionPersister.isInverse.

Is this collection "inverse", so state changes are not propagated to the database.
public boolean
public abstract boolean
public boolean
isMutable()

Implements org.hibernate.persister.collection.CollectionPersister.isMutable.

Can the elements of this collection change?
public boolean
protected boolean
protected boolean
public boolean
public boolean
isVersioned()

Implements org.hibernate.persister.collection.CollectionPersister.isVersioned.

Does this collection cause version increment of the owning entity?
protected void
public boolean
needsRemove()

Overrides default org.hibernate.persister.collection.CollectionPersister.needsRemove.

Whether remove(Object, SharedSessionContractImplementor) might actually do something, or if it is definitely a no-op.
public void
public void
processQueuedOps(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.processQueuedOps.

Process queued operations within the PersistentCollection.
private static String[]
qualify(String alias, String[] columnNames, String[] formulaTemplates)

public void
registerAffectingFetchProfile(String fetchProfileName)

Implements org.hibernate.engine.profile.internal.FetchProfileAffectee.registerAffectingFetchProfile.

Register the profile name with the entity/collection
public void
remove(Object id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.remove.

Completely remove the persistent state of the collection
private CollectionLoader
public String
selectFragment(String alias, String columnSuffix)

Implements org.hibernate.persister.collection.QueryableCollection.selectFragment.

Generate a list of collection index, key and element columns
public String[]
toColumns(String propertyName)

Implements org.hibernate.persister.entity.PropertyMapping.toColumns.

Given a property path, return the corresponding column name(s).
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public Type
toType(String propertyName)

Implements org.hibernate.persister.entity.PropertyMapping.toType.

Given a component path expression, get the type of the property
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait