FileDocCategorySizeDatePackage
CollectionPersister.javaAPI DocHibernate 3.2.58416Thu May 04 11:23:44 BST 2006org.hibernate.persister.collection

CollectionPersister

public interface CollectionPersister
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
see
QueryableCollection
see
PersistentCollection
author
Gavin King

Fields Summary
Constructors Summary
Methods Summary
public voiddeleteRows(org.hibernate.collection.PersistentCollection collection, java.io.Serializable key, org.hibernate.engine.SessionImplementor session)
Delete the persistent state of any elements that were removed from the collection

public booleanelementExists(java.io.Serializable key, java.lang.Object element, org.hibernate.engine.SessionImplementor session)

public org.hibernate.cache.CacheConcurrencyStrategygetCache()
Get the cache

public org.hibernate.cache.entry.CacheEntryStructuregetCacheEntryStructure()
Get the cache structure

public org.hibernate.metadata.CollectionMetadatagetCollectionMetadata()

public java.io.Serializable[]getCollectionSpaces()
Get the "space" that holds the persistent state

public org.hibernate.type.CollectionTypegetCollectionType()
Get the associated Type

public java.lang.ObjectgetElementByIndex(java.io.Serializable key, java.lang.Object index, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)

public java.lang.ClassgetElementClass()
Return the element class of an array, or null otherwise

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

param
suffix The suffix to use in the element column alias generation.
return
The key column aliases.

public java.lang.StringgetElementNodeName()

public org.hibernate.type.TypegetElementType()
Get the "element" type

public org.hibernate.engine.SessionFactoryImplementorgetFactory()

public java.lang.StringgetIdentifierColumnAlias(java.lang.String suffix)
Generates the collection's identifier column aliases, based on the given suffix.

param
suffix The suffix to use in the key column alias generation.
return
The key column aliases.

public org.hibernate.id.IdentifierGeneratorgetIdentifierGenerator()
Get the surrogate key generation strategy (optional operation)

public org.hibernate.type.TypegetIdentifierType()
Get the type of the surrogate key

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

param
suffix The suffix to use in the index column alias generation.
return
The key column aliases, or null if not indexed.

public java.lang.StringgetIndexNodeName()

public org.hibernate.type.TypegetIndexType()
Get the "index" type for a list or map (optional operation)

public java.lang.String[]getKeyColumnAliases(java.lang.String suffix)
Generates the collection's key column aliases, based on the given suffix.

param
suffix The suffix to use in the key column alias generation.
return
The key column aliases.

public org.hibernate.type.TypegetKeyType()
Get the "key" type (the type of the foreign key)

public java.lang.StringgetManyToManyFilterFragment(java.lang.String alias, java.util.Map enabledFilters)

public java.lang.StringgetNodeName()

public org.hibernate.persister.entity.EntityPersistergetOwnerEntityPersister()
Get the persister of the entity that "owns" this collection

public java.lang.StringgetRole()
Get the name of this collection role (the fully qualified class name, extended by a "property path")

public intgetSize(java.io.Serializable key, org.hibernate.engine.SessionImplementor session)

public booleanhasCache()
Is this collection role cacheable

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

public booleanhasManyToManyOrdering()

public booleanhasOrdering()
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 booleanhasOrphanDelete()
Does this collection implement "orphan delete"?

public booleanindexExists(java.io.Serializable key, java.lang.Object index, org.hibernate.engine.SessionImplementor session)

public voidinitialize(java.io.Serializable key, org.hibernate.engine.SessionImplementor session)
Initialize the given collection with the given key

public voidinsertRows(org.hibernate.collection.PersistentCollection collection, java.io.Serializable key, org.hibernate.engine.SessionImplementor session)
Insert the persistent state of any new collection elements

public booleanisAffectedByEnabledFilters(org.hibernate.engine.SessionImplementor session)

public booleanisArray()
Is this an array?

public abstract booleanisCascadeDeleteEnabled()
Is cascade delete handled by the database-level foreign key constraint definition?

public booleanisExtraLazy()

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

public booleanisLazy()
Is this collection lazyily initialized?

public booleanisManyToMany()
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 booleanisMutable()
Can the elements of this collection change?

public booleanisOneToMany()
Is this a one-to-many association?

public booleanisPrimitiveArray()
Is this an array or primitive values?

public booleanisVersioned()
Does this collection cause version increment of the owning entity?

public voidpostInstantiate()

public java.lang.ObjectreadElement(java.sql.ResultSet rs, java.lang.Object owner, java.lang.String[] columnAliases, org.hibernate.engine.SessionImplementor session)
Read the element from a row of the JDBC ResultSet

public java.lang.ObjectreadIdentifier(java.sql.ResultSet rs, java.lang.String columnAlias, org.hibernate.engine.SessionImplementor session)
Read the identifier from a row of the JDBC ResultSet

public java.lang.ObjectreadIndex(java.sql.ResultSet rs, java.lang.String[] columnAliases, org.hibernate.engine.SessionImplementor session)
Read the index from a row of the JDBC ResultSet

public java.lang.ObjectreadKey(java.sql.ResultSet rs, java.lang.String[] keyAliases, org.hibernate.engine.SessionImplementor session)
Read the key from a row of the JDBC ResultSet

public voidrecreate(org.hibernate.collection.PersistentCollection collection, java.io.Serializable key, org.hibernate.engine.SessionImplementor session)
(Re)create the collection's persistent state

public voidremove(java.io.Serializable id, org.hibernate.engine.SessionImplementor session)
Completely remove the persistent state of the collection

public voidupdateRows(org.hibernate.collection.PersistentCollection collection, java.io.Serializable key, org.hibernate.engine.SessionImplementor session)
Update the persistent state of any elements that were modified