Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hibernate.persister.collection
Interface CollectionPersister  view CollectionPersister download CollectionPersister.java

All Known Subinterfaces:
QueryableCollection, SQLLoadableCollection
All Known Implementing Classes:
AbstractCollectionPersister

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


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

Method Detail

initialize

public void initialize(java.io.Serializable key,
                       org.hibernate.engine.SessionImplementor session)
                throws org.hibernate.HibernateException
Initialize the given collection with the given key


getCache

public org.hibernate.cache.CacheConcurrencyStrategy getCache()
Get the cache


hasCache

public boolean hasCache()
Is this collection role cacheable


getCacheEntryStructure

public org.hibernate.cache.entry.CacheEntryStructure getCacheEntryStructure()
Get the cache structure


getCollectionType

public org.hibernate.type.CollectionType getCollectionType()
Get the associated Type


getKeyType

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


getIndexType

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


getElementType

public org.hibernate.type.Type getElementType()
Get the "element" type


getElementClass

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


readKey

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


readElement

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


readIndex

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


readIdentifier

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


isPrimitiveArray

public boolean isPrimitiveArray()
Is this an array or primitive values?


isArray

public boolean isArray()
Is this an array?


isOneToMany

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


isManyToMany

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.


getManyToManyFilterFragment

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

hasIndex

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


isLazy

public boolean isLazy()
Is this collection lazyily initialized?


isInverse

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


remove

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


recreate

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


deleteRows

public void deleteRows(org.hibernate.collection.PersistentCollection collection,
                       java.io.Serializable key,
                       org.hibernate.engine.SessionImplementor session)
                throws org.hibernate.HibernateException
Delete the persistent state of any elements that were removed from the collection


updateRows

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


insertRows

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


getRole

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


getOwnerEntityPersister

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


getIdentifierGenerator

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


getIdentifierType

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


hasOrphanDelete

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


hasOrdering

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


hasManyToManyOrdering

public boolean hasManyToManyOrdering()

getCollectionSpaces

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


getCollectionMetadata

public org.hibernate.metadata.CollectionMetadata getCollectionMetadata()

isCascadeDeleteEnabled

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


isVersioned

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


isMutable

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


getNodeName

public java.lang.String getNodeName()

getElementNodeName

public java.lang.String getElementNodeName()

getIndexNodeName

public java.lang.String getIndexNodeName()

postInstantiate

public void postInstantiate()
                     throws org.hibernate.MappingException

getFactory

public org.hibernate.engine.SessionFactoryImplementor getFactory()

isAffectedByEnabledFilters

public boolean isAffectedByEnabledFilters(org.hibernate.engine.SessionImplementor session)

getKeyColumnAliases

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


getIndexColumnAliases

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


getElementColumnAliases

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


getIdentifierColumnAlias

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


isExtraLazy

public boolean isExtraLazy()

getSize

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

indexExists

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

elementExists

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

getElementByIndex

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