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
elementExists
public boolean elementExists(Serializable key,
Object element,
SessionImplementor session)
getCacheEntryStructure
public CacheEntryStructure getCacheEntryStructure()
Get the cache structure
getCollectionSpaces
public Serializable[] getCollectionSpaces()
Get the "space" that holds the persistent state
getCollectionType
public CollectionType getCollectionType()
Get the associated Type
getElementByIndex
public Object getElementByIndex(Serializable key,
Object index,
SessionImplementor session,
Object owner)
getElementClass
public Class getElementClass()
Return the element class of an array, or null otherwise
getElementColumnAliases
public String[] getElementColumnAliases(String suffix)
Generates the collection's element column aliases, based on the given
suffix.
suffix
- The suffix to use in the element column alias generation.
getElementNodeName
public String getElementNodeName()
getElementType
public Type getElementType()
Get the "element" type
getIdentifierColumnAlias
public String getIdentifierColumnAlias(String suffix)
Generates the collection's identifier column aliases, based on the given
suffix.
suffix
- The suffix to use in the key column alias generation.
getIdentifierGenerator
public IdentifierGenerator getIdentifierGenerator()
Get the surrogate key generation strategy (optional operation)
getIdentifierType
public Type getIdentifierType()
Get the type of the surrogate key
getIndexColumnAliases
public String[] getIndexColumnAliases(String suffix)
Generates the collection's index column aliases, based on the given
suffix.
suffix
- The suffix to use in the index column alias generation.
- The key column aliases, or null if not indexed.
getIndexNodeName
public String getIndexNodeName()
getIndexType
public Type getIndexType()
Get the "index" type for a list or map (optional operation)
getKeyColumnAliases
public String[] getKeyColumnAliases(String suffix)
Generates the collection's key column aliases, based on the given
suffix.
suffix
- The suffix to use in the key column alias generation.
getKeyType
public Type getKeyType()
Get the "key" type (the type of the foreign key)
getManyToManyFilterFragment
public String getManyToManyFilterFragment(String alias,
Map enabledFilters)
getNodeName
public String getNodeName()
getOwnerEntityPersister
public EntityPersister getOwnerEntityPersister()
Get the persister of the entity that "owns" this collection
getRole
public String getRole()
Get the name of this collection role (the fully qualified class name,
extended by a "property path")
hasCache
public boolean hasCache()
Is this collection role cacheable
hasIndex
public boolean hasIndex()
Is this an "indexed" collection? (list or map)
hasManyToManyOrdering
public boolean hasManyToManyOrdering()
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.)
hasOrphanDelete
public boolean hasOrphanDelete()
Does this collection implement "orphan delete"?
indexExists
public boolean indexExists(Serializable key,
Object index,
SessionImplementor session)
isAffectedByEnabledFilters
public boolean isAffectedByEnabledFilters(SessionImplementor session)
isArray
public boolean isArray()
Is this an array?
isCascadeDeleteEnabled
public abstract boolean isCascadeDeleteEnabled()
Is cascade delete handled by the database-level
foreign key constraint definition?
isExtraLazy
public boolean isExtraLazy()
isInverse
public boolean isInverse()
Is this collection "inverse", so state changes are not
propogated to the database.
isLazy
public boolean isLazy()
Is this collection lazyily initialized?
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.
isMutable
public boolean isMutable()
Can the elements of this collection change?
isOneToMany
public boolean isOneToMany()
Is this a one-to-many association?
isPrimitiveArray
public boolean isPrimitiveArray()
Is this an array or primitive values?
isVersioned
public boolean isVersioned()
Does this collection cause version increment of the
owning entity?
readElement
public Object readElement(ResultSet rs,
Object owner,
String[] columnAliases,
SessionImplementor session)
throws HibernateException,
SQLException
Read the element from a row of the JDBC ResultSet
readIdentifier
public Object readIdentifier(ResultSet rs,
String columnAlias,
SessionImplementor session)
throws HibernateException,
SQLException
Read the identifier from a row of the JDBC ResultSet
readIndex
public Object readIndex(ResultSet rs,
String[] columnAliases,
SessionImplementor session)
throws HibernateException,
SQLException
Read the index from a row of the JDBC ResultSet