Save This Page
Home » Hibernate-3.3.2.GA » org.hibernate » persister » collection » [javadoc | source]
org.hibernate.persister.collection
public interface: CollectionPersister [javadoc | source]

All Known Implementing Classes:
    SQLLoadableCollection, OneToManyPersister, QueryableCollection, AbstractCollectionPersister, BasicCollectionPersister

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