CollectionPersister orchestrates rendering of SQL statements
corresponding to basic lifecycle events, including insert,
update, and delete statements, and their execution via
JDBC.
Concrete implementations of this interface handle one-to-many and many-to-many association cardinalities, and to a certain extent abstract the details of those mappings from collaborators.
Note that an instance of PersistentCollection may change roles.
This object implements persistence of a collection instance while the
instance is referenced in a particular role.
This interface defines a contract between the persistence strategy and
the actual persistent collection framework
and session. It does
not define operations that are required for querying collections, nor
for loading by outer join. Implementations are highly coupled to the
PersistentCollection hierarchy, since double dispatch is used to
load and update collection elements.
Unless a custom org. is
used, it is expected that implementations of CollectionPersister
define a constructor accepting the following arguments:
org.hibernate.mapping.Collection - The metadata about
the collection to be handled by the persister,
CollectionDataAccess - the second level caching strategy
for this collection, and
RuntimeModelCreationContext - access to additional
information useful while constructing the persister.
PersistentCollection, PluralAttributeMapping
| Modifier and Type | Method and Description |
|---|---|
| public void | applyBaseManyToManyRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String, Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)
|
| public void | deleteRows(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)
Delete the persistent state of any elements that were removed from the collection |
| public boolean | |
| public default PluralAttributeMapping | |
| public default int | |
| public CollectionDataAccess | |
| public CacheEntryStructure | |
| public CollectionMetadata | getCollectionMetadata()
Deprecated
since 6.0. This operation is no longer called by Hibernate.
Get the user-visible metadata for the collection (optional operation)
|
| public CollectionSemantics | |
| public String[] | |
| public CollectionType | getCollectionType()
Deprecated
for removal. Hibernate is moving away from
Get the associated Type.
Type
|
| public Object | |
| public Class | |
| public String[] | Returns: The key column aliases.The suffix to use in the element column alias generation. suffix)
Deprecated
for removal since 6. Read-by-position makes this irrelevant. Currently still used
by
Generates the collection's element column aliases, based on the given
suffix.
org.
|
| public Type | |
| public SessionFactoryImplementor | |
| public default BeforeExecutionGenerator | |
| public String | Returns: The key column aliases.The suffix to use in the key column alias generation. suffix)
Deprecated
for removal since 6. Read-by-position makes this irrelevant. Currently still used
by
Generates the collection's identifier column aliases, based on the given
suffix.
org.
|
| public IdentifierGenerator | getIdentifierGenerator()
Deprecated
use
Get the surrogate key generation strategy (optional operation)
getGenerator()
|
| public Type | getIdentifierType()
Deprecated
for removal. Hibernate is moving away from
Get the type of the surrogate key
Type.
|
| public String[] | Returns: The key column aliases, or null if not indexed.The suffix to use in the index column alias generation. suffix)
Deprecated
for removal since 6. Read-by-position makes this irrelevant. Currently still used
by
Generates the collection's index column aliases, based on the given
suffix.
org.
|
| public Type | getIndexType()
Deprecated
for removal. Hibernate is moving away from
Get the "index" type for a list or map (optional operation)
Type.
|
| public String[] | Returns: The key column aliases.The suffix to use in the key column alias generation. suffix)
Deprecated
for removal since 6. Read-by-position makes this irrelevant. Currently still used
by
Generates the collection's key column aliases, based on the given
suffix.
org.
|
| public Type | getKeyType()
Deprecated
for removal. Hibernate is moving away from
Get the "key" type (the type of the foreign key)
Type.
|
| public String | |
| public String | |
| public NavigableRole | |
| public EntityPersister | |
| public default String | |
| public int | |
| public Comparator | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | initialize(Object key, SharedSessionContractImplementor session)
Initialize the given collection with the given key |
| public void | insertRows(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)
Insert the persistent state of any new collection elements |
| public default boolean | |
| public boolean | |
| public default boolean | |
| public default boolean | |
| public boolean | |
| public default boolean | |
| public boolean | isCascadeDeleteEnabled()
Is cascade delete handled by the database-level foreign key constraint definition? |
| public default boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public default boolean | |
| public boolean | |
| public default boolean | needsRemove()
Whether |
| public void | |
| public void | processQueuedOps(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)
Process queued operations within the PersistentCollection. |
| public void | recreate(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)
(Re)create the collection's persistent state |
| public void | remove(Object id, SharedSessionContractImplementor session)
Completely remove the persistent state of the collection |
| public void | updateRows(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)
Update the persistent state of any elements that were modified |
| applyBaseManyToManyRestrictions | back to summary |
|---|---|
| public void applyBaseManyToManyRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String, Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState) | |
| deleteRows | back to summary |
|---|---|
| public void deleteRows(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session) Delete the persistent state of any elements that were removed from the collection | |
| elementExists | back to summary |
|---|---|
| public boolean elementExists(Object key, Object element, SharedSessionContractImplementor session) | |
| getAttributeMapping | back to summary |
|---|---|
| public default PluralAttributeMapping getAttributeMapping() | |
| getBatchSize | back to summary |
|---|---|
| public default int getBatchSize() | |
| getCacheAccessStrategy | back to summary |
|---|---|
| public CollectionDataAccess getCacheAccessStrategy() Access to the collection's cache region | |
| getCacheEntryStructure | back to summary |
|---|---|
| public CacheEntryStructure getCacheEntryStructure() Get the structure used to store data into the collection's cache region | |
| getCollectionMetadata | back to summary |
|---|---|
| public CollectionMetadata getCollectionMetadata()
Deprecated since 6.0. This operation is no longer called by Hibernate. Get the user-visible metadata for the collection (optional operation)
| |
| getCollectionSemantics | back to summary |
|---|---|
| public CollectionSemantics | |
| getCollectionSpaces | back to summary |
|---|---|
| public String[] getCollectionSpaces() Get the "space" that holds the persistent state | |
| getCollectionType | back to summary |
|---|---|
| public CollectionType getCollectionType()
Deprecated for removal. Hibernate is moving away from Get the associated
| |
| getElementByIndex | back to summary |
|---|---|
| public Object getElementByIndex(Object key, Object index, SharedSessionContractImplementor session, Object owner) | |
| getElementClass | back to summary |
|---|---|
| public Class Return the element class of an array, or null otherwise | |
| getElementColumnAliases | back to summary |
|---|---|
| public String[] getElementColumnAliases(String suffix)
Deprecated for removal since 6. Read-by-position makes this irrelevant. Currently still used
by Generates the collection's element column aliases, based on the given suffix.
| |
| getElementType | back to summary |
|---|---|
| public Type getElementType()
Deprecated for removal. Hibernate is moving away from Get the "element" type
| |
| getFactory | back to summary |
|---|---|
| public SessionFactoryImplementor getFactory()
Deprecated as a consequence of | |
| getGenerator | back to summary |
|---|---|
| public default BeforeExecutionGenerator getGenerator() Get the surrogate key generation strategy (optional operation) | |
| getIdentifierColumnAlias | back to summary |
|---|---|
| public String getIdentifierColumnAlias(String suffix)
Deprecated for removal since 6. Read-by-position makes this irrelevant. Currently still used
by Generates the collection's identifier column aliases, based on the given suffix.
| |
| getIdentifierGenerator | back to summary |
|---|---|
| public IdentifierGenerator getIdentifierGenerator()
Deprecated use Get the surrogate key generation strategy (optional operation)
| |
| getIdentifierType | back to summary |
|---|---|
| public Type getIdentifierType()
Deprecated for removal. Hibernate is moving away from Get the type of the surrogate key
| |
| getIndexColumnAliases | back to summary |
|---|---|
| public String[] getIndexColumnAliases(String suffix)
Deprecated for removal since 6. Read-by-position makes this irrelevant. Currently still used
by Generates the collection's index column aliases, based on the given suffix.
| |
| getIndexType | back to summary |
|---|---|
| public Type getIndexType()
Deprecated for removal. Hibernate is moving away from Get the "index" type for a list or map (optional operation)
| |
| getKeyColumnAliases | back to summary |
|---|---|
| public String[] getKeyColumnAliases(String suffix)
Deprecated for removal since 6. Read-by-position makes this irrelevant. Currently still used
by Generates the collection's key column aliases, based on the given suffix.
| |
| getKeyType | back to summary |
|---|---|
| public Type getKeyType()
Deprecated for removal. Hibernate is moving away from Get the "key" type (the type of the foreign key)
| |
| getManyToManyFilterFragment | back to summary |
|---|---|
| public String getManyToManyFilterFragment(TableGroup tableGroup, Map<String, Filter> enabledFilters) | |
| getMappedByProperty | back to summary |
|---|---|
public String getMappedByProperty()
| |
| getNavigableRole | back to summary |
|---|---|
| public NavigableRole getNavigableRole() The NavigableRole for this collection. | |
| getOwnerEntityPersister | back to summary |
|---|---|
| public EntityPersister getOwnerEntityPersister() Get the persister of the entity that "owns" this collection | |
| getRole | back to summary |
|---|---|
| public default String getRole() | |
| getSize | back to summary |
|---|---|
| public int getSize(Object key, SharedSessionContractImplementor session) | |
| getSortingComparator | back to summary |
|---|---|
| public Comparator For sorted collections, the comparator to use. Non-parameterized because for SORTED_SET the elements are compared but for SORTED_MAP the keys are compared | |
| hasCache | back to summary |
|---|---|
| public boolean hasCache() Is this collection role cacheable | |
| hasIndex | back to summary |
|---|---|
| public boolean hasIndex() Is this an "indexed" collection? (list or map) | |
| hasManyToManyOrdering | back to summary |
|---|---|
| public boolean hasManyToManyOrdering() | |
| hasOrdering | back to summary |
|---|---|
| public boolean hasOrdering() Is this an ordered collection? (An ordered collection is ordered by the initialization operation, not by sorting that happens in memory, as in the case of a sorted collection.) | |
| hasOrphanDelete | back to summary |
|---|---|
| public boolean hasOrphanDelete() Does this collection implement "orphan delete"? | |
| indexExists | back to summary |
|---|---|
| public boolean indexExists(Object key, Object index, SharedSessionContractImplementor session) | |
| initialize | back to summary |
|---|---|
| public void initialize(Object key, SharedSessionContractImplementor session) throws HibernateException Initialize the given collection with the given key | |
| insertRows | back to summary |
|---|---|
| public void insertRows(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session) Insert the persistent state of any new collection elements | |
| isAffectedByEnabledFetchProfiles | back to summary |
|---|---|
| public default boolean isAffectedByEnabledFetchProfiles(LoadQueryInfluencers influencers) | |
| isAffectedByEnabledFilters | back to summary |
|---|---|
| public boolean isAffectedByEnabledFilters(SharedSessionContractImplementor session) | |
| isAffectedByEnabledFilters | back to summary |
|---|---|
| public default boolean isAffectedByEnabledFilters(LoadQueryInfluencers influencers) | |
| isAffectedByEntityGraph | back to summary |
|---|---|
| public default boolean isAffectedByEntityGraph(LoadQueryInfluencers influencers) | |
| isArray | back to summary |
|---|---|
| public boolean isArray() Is this an array? | |
| isBatchLoadable | back to summary |
|---|---|
| public default boolean isBatchLoadable() | |
| isCascadeDeleteEnabled | back to summary |
|---|---|
| public boolean isCascadeDeleteEnabled() Is cascade delete handled by the database-level foreign key constraint definition? | |
| isExtraLazy | back to summary |
|---|---|
| public default boolean isExtraLazy() | |
| isInverse | back to summary |
|---|---|
| public boolean isInverse() Is this collection "inverse", so state changes are not propagated to the database. | |
| isLazy | back to summary |
|---|---|
| public boolean isLazy() Is this collection lazily initialized? | |
| isManyToMany | back to summary |
|---|---|
| public 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. | |
| isMutable | back to summary |
|---|---|
| public boolean isMutable() Can the elements of this collection change? | |
| isOneToMany | back to summary |
|---|---|
| public boolean isOneToMany() Is this a one-to-many association? | |
| isPrimitiveArray | back to summary |
|---|---|
| public boolean isPrimitiveArray() Is this an array or primitive values? | |
| isSubselectLoadable | back to summary |
|---|---|
| public default boolean isSubselectLoadable() | |
| isVersioned | back to summary |
|---|---|
| public boolean isVersioned() Does this collection cause version increment of the owning entity? | |
| needsRemove | back to summary |
|---|---|
| public default boolean needsRemove() Whether | |
| postInstantiate | back to summary |
|---|---|
| public void postInstantiate() throws MappingException | |
| processQueuedOps | back to summary |
|---|---|
| public void processQueuedOps(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session) Process queued operations within the PersistentCollection. | |
| recreate | back to summary |
|---|---|
| public void recreate(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session) (Re)create the collection's persistent state | |
| remove | back to summary |
|---|---|
| public void remove(Object id, SharedSessionContractImplementor session) Completely remove the persistent state of the collection | |
| updateRows | back to summary |
|---|---|
| public void updateRows(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session) Update the persistent state of any elements that were modified | |