public interface

CollectionPersister

org.hibernate.persister.collection.CollectionPersister
Known Indirect Subclasses

Class Overview

A strategy for persisting a collection role. Defines a contract between the persistence strategy and the actual persistent collection framework and session. Does not define operations that are required for querying collections, or loading by outer join.

Implements persistence of a collection instance while the instance is referenced in a particular role.

This class is highly coupled to the PersistentCollection hierarchy, since double dispatch is used to load and update collection elements.

May be considered an immutable view of the mapping object

Summary

Public Methods
abstract void deleteRows(PersistentCollection collection, Serializable key, SessionImplementor session)
Delete the persistent state of any elements that were removed from the collection
abstract boolean elementExists(Serializable key, Object element, SessionImplementor session)
abstract CollectionRegionAccessStrategy getCacheAccessStrategy()
Get the cache
abstract CacheEntryStructure getCacheEntryStructure()
Get the cache structure
abstract CollectionMetadata getCollectionMetadata()
abstract Serializable[] getCollectionSpaces()
Get the "space" that holds the persistent state
abstract CollectionType getCollectionType()
Get the associated Type
abstract Object getElementByIndex(Serializable key, Object index, SessionImplementor session, Object owner)
abstract Class getElementClass()
Return the element class of an array, or null otherwise
abstract String[] getElementColumnAliases(String suffix)
Generates the collection's element column aliases, based on the given suffix.
abstract String getElementNodeName()
abstract Type getElementType()
Get the "element" type
abstract SessionFactoryImplementor getFactory()
abstract String getIdentifierColumnAlias(String suffix)
Generates the collection's identifier column aliases, based on the given suffix.
abstract IdentifierGenerator getIdentifierGenerator()
Get the surrogate key generation strategy (optional operation)
abstract Type getIdentifierType()
Get the type of the surrogate key
abstract String[] getIndexColumnAliases(String suffix)
Generates the collection's index column aliases, based on the given suffix.
abstract String getIndexNodeName()
abstract Type getIndexType()
Get the "index" type for a list or map (optional operation)
abstract String[] getKeyColumnAliases(String suffix)
Generates the collection's key column aliases, based on the given suffix.
abstract Type getKeyType()
Get the "key" type (the type of the foreign key)
abstract String getManyToManyFilterFragment(String alias, Map enabledFilters)
abstract String getNodeName()
abstract EntityPersister getOwnerEntityPersister()
Get the persister of the entity that "owns" this collection
abstract String getRole()
Get the name of this collection role (the fully qualified class name, extended by a "property path")
abstract int getSize(Serializable key, SessionImplementor session)
abstract boolean hasCache()
Is this collection role cacheable
abstract boolean hasIndex()
Is this an "indexed" collection? (list or map)
abstract boolean hasManyToManyOrdering()
abstract 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.)
abstract boolean hasOrphanDelete()
Does this collection implement "orphan delete"?
abstract boolean indexExists(Serializable key, Object index, SessionImplementor session)
abstract void initialize(Serializable key, SessionImplementor session)
Initialize the given collection with the given key
abstract void insertRows(PersistentCollection collection, Serializable key, SessionImplementor session)
Insert the persistent state of any new collection elements
abstract boolean isAffectedByEnabledFilters(SessionImplementor session)
abstract boolean isArray()
Is this an array?
abstract boolean isCascadeDeleteEnabled()
Is cascade delete handled by the database-level foreign key constraint definition?
abstract boolean isExtraLazy()
abstract boolean isInverse()
Is this collection "inverse", so state changes are not propogated to the database.
abstract boolean isLazy()
Is this collection lazyily initialized?
abstract boolean isManyToMany()
Is this a many-to-many association? Note that this is mainly a convenience feature as the single persister does not conatin all the information needed to handle a many-to-many itself, as internally it is looked at as two many-to-ones.
abstract boolean isMutable()
Can the elements of this collection change?
abstract boolean isOneToMany()
Is this a one-to-many association?
abstract boolean isPrimitiveArray()
Is this an array or primitive values?
abstract boolean isVersioned()
Does this collection cause version increment of the owning entity?
abstract void postInstantiate()
abstract Object readElement(ResultSet rs, Object owner, String[] columnAliases, SessionImplementor session)
Read the element from a row of the JDBC ResultSet
abstract Object readIdentifier(ResultSet rs, String columnAlias, SessionImplementor session)
Read the identifier from a row of the JDBC ResultSet
abstract Object readIndex(ResultSet rs, String[] columnAliases, SessionImplementor session)
Read the index from a row of the JDBC ResultSet
abstract Object readKey(ResultSet rs, String[] keyAliases, SessionImplementor session)
Read the key from a row of the JDBC ResultSet
abstract void recreate(PersistentCollection collection, Serializable key, SessionImplementor session)
(Re)create the collection's persistent state
abstract void remove(Serializable id, SessionImplementor session)
Completely remove the persistent state of the collection
abstract void updateRows(PersistentCollection collection, Serializable key, SessionImplementor session)
Update the persistent state of any elements that were modified

Public Methods

public abstract void deleteRows (PersistentCollection collection, Serializable key, SessionImplementor session)

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

public abstract boolean elementExists (Serializable key, Object element, SessionImplementor session)

public abstract CollectionRegionAccessStrategy getCacheAccessStrategy ()

Get the cache

public abstract CacheEntryStructure getCacheEntryStructure ()

Get the cache structure

public abstract CollectionMetadata getCollectionMetadata ()

public abstract Serializable[] getCollectionSpaces ()

Get the "space" that holds the persistent state

public abstract CollectionType getCollectionType ()

Get the associated Type

public abstract Object getElementByIndex (Serializable key, Object index, SessionImplementor session, Object owner)

public abstract Class getElementClass ()

Return the element class of an array, or null otherwise

public abstract String[] getElementColumnAliases (String suffix)

Generates the collection's element column aliases, based on the given suffix.

Parameters
suffix The suffix to use in the element column alias generation.
Returns
  • The key column aliases.

public abstract String getElementNodeName ()

public abstract Type getElementType ()

Get the "element" type

public abstract SessionFactoryImplementor getFactory ()

public abstract String getIdentifierColumnAlias (String suffix)

Generates the collection's identifier column aliases, based on the given suffix.

Parameters
suffix The suffix to use in the key column alias generation.
Returns
  • The key column aliases.

public abstract IdentifierGenerator getIdentifierGenerator ()

Get the surrogate key generation strategy (optional operation)

public abstract Type getIdentifierType ()

Get the type of the surrogate key

public abstract String[] getIndexColumnAliases (String suffix)

Generates the collection's index column aliases, based on the given suffix.

Parameters
suffix The suffix to use in the index column alias generation.
Returns
  • The key column aliases, or null if not indexed.

public abstract String getIndexNodeName ()

public abstract Type getIndexType ()

Get the "index" type for a list or map (optional operation)

public abstract String[] getKeyColumnAliases (String suffix)

Generates the collection's key column aliases, based on the given suffix.

Parameters
suffix The suffix to use in the key column alias generation.
Returns
  • The key column aliases.

public abstract Type getKeyType ()

Get the "key" type (the type of the foreign key)

public abstract String getManyToManyFilterFragment (String alias, Map enabledFilters)

public abstract String getNodeName ()

public abstract EntityPersister getOwnerEntityPersister ()

Get the persister of the entity that "owns" this collection

public abstract String getRole ()

Get the name of this collection role (the fully qualified class name, extended by a "property path")

public abstract int getSize (Serializable key, SessionImplementor session)

public abstract boolean hasCache ()

Is this collection role cacheable

public abstract boolean hasIndex ()

Is this an "indexed" collection? (list or map)

public abstract boolean hasManyToManyOrdering ()

public abstract 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.)

public abstract boolean hasOrphanDelete ()

Does this collection implement "orphan delete"?

public abstract boolean indexExists (Serializable key, Object index, SessionImplementor session)

public abstract void initialize (Serializable key, SessionImplementor session)

Initialize the given collection with the given key

public abstract void insertRows (PersistentCollection collection, Serializable key, SessionImplementor session)

Insert the persistent state of any new collection elements

public abstract boolean isAffectedByEnabledFilters (SessionImplementor session)

public abstract boolean isArray ()

Is this an array?

public abstract boolean isCascadeDeleteEnabled ()

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

public abstract boolean isExtraLazy ()

public abstract boolean isInverse ()

Is this collection "inverse", so state changes are not propogated to the database.

public abstract boolean isLazy ()

Is this collection lazyily initialized?

public abstract boolean isManyToMany ()

Is this a many-to-many association? Note that this is mainly a convenience feature as the single persister does not conatin all the information needed to handle a many-to-many itself, as internally it is looked at as two many-to-ones.

public abstract boolean isMutable ()

Can the elements of this collection change?

public abstract boolean isOneToMany ()

Is this a one-to-many association?

public abstract boolean isPrimitiveArray ()

Is this an array or primitive values?

public abstract boolean isVersioned ()

Does this collection cause version increment of the owning entity?

public abstract void postInstantiate ()

public abstract Object readElement (ResultSet rs, Object owner, String[] columnAliases, SessionImplementor session)

Read the element from a row of the JDBC ResultSet

public abstract Object readIdentifier (ResultSet rs, String columnAlias, SessionImplementor session)

Read the identifier from a row of the JDBC ResultSet

public abstract Object readIndex (ResultSet rs, String[] columnAliases, SessionImplementor session)

Read the index from a row of the JDBC ResultSet

public abstract Object readKey (ResultSet rs, String[] keyAliases, SessionImplementor session)

Read the key from a row of the JDBC ResultSet

public abstract void recreate (PersistentCollection collection, Serializable key, SessionImplementor session)

(Re)create the collection's persistent state

public abstract void remove (Serializable id, SessionImplementor session)

Completely remove the persistent state of the collection

public abstract void updateRows (PersistentCollection collection, Serializable key, SessionImplementor session)

Update the persistent state of any elements that were modified