org.hibernate.persister.collection

Class AbstractCollectionPersister

Implemented Interfaces:
CollectionMetadata, CollectionPersister, Joinable, PropertyMapping, QueryableCollection, SQLLoadableCollection
Known Direct Subclasses:
BasicCollectionPersister, OneToManyPersister

public abstract class AbstractCollectionPersister
extends java.lang.Object
implements CollectionMetadata, SQLLoadableCollection

Base implementation of the QueryableCollection interface.
Author:
Gavin King
See Also:
BasicCollectionPersister, OneToManyPersister

Field Summary

protected int
batchSize
protected String[]
elementColumnAliases
protected boolean[]
elementColumnIsInPrimaryKey
protected boolean[]
elementColumnIsSettable
protected String[]
elementColumnNames
protected String[]
elementFormulaTemplates
protected String[]
elementFormulas
protected boolean
elementIsPureFormula
protected Type
elementType
protected boolean
hasIdentifier
protected boolean
hasIndex
protected boolean
hasWhere
protected String
identifierColumnName
protected String[]
indexColumnAliases
protected boolean[]
indexColumnIsSettable
protected String[]
indexColumnNames
protected boolean
indexContainsFormula
protected String[]
indexFormulaTemplates
protected String[]
indexFormulas
protected String[]
keyColumnAliases
protected String[]
keyColumnNames
protected String
qualifiedTableName
protected String
sqlWhereString

Constructor Summary

AbstractCollectionPersister(Collection collection, CollectionRegionAccessStrategy cacheAccessStrategy, Configuration cfg, SessionFactoryImplementor factory)

Method Summary

protected void
appendElementColumns(SelectFragment frag, String elemAlias)
protected void
appendIdentifierColumns(SelectFragment frag, String alias)
protected void
appendIndexColumns(SelectFragment frag, String alias)
protected abstract CollectionInitializer
createCollectionInitializer(Map enabledFilters)
protected abstract CollectionInitializer
createSubselectInitializer(SubselectFetch subselect, SessionImplementor session)
protected Object
decrementIndexByBase(Object index)
void
deleteRows(PersistentCollection collection, Serializable id, SessionImplementor session)
Delete the persistent state of any elements that were removed from the collection
protected abstract int
doUpdateRows(Serializable key, PersistentCollection collection, SessionImplementor session)
boolean
elementExists(Serializable key, Object element, SessionImplementor session)
protected String
filterFragment(String alias)
String
filterFragment(String alias, Map enabledFilters)
Get the where clause filter, given a query alias and considering enabled session filters
protected abstract String
generateDeleteRowString()
protected abstract String
generateDeleteString()
protected String
generateDetectRowByElementString()
protected String
generateDetectRowByIndexString()
protected abstract String
generateInsertRowString()
protected SelectFragment
generateSelectFragment(String alias, String columnSuffix)
protected String
generateSelectRowByIndexString()
protected String
generateSelectSizeString(boolean isIntegerIndexed)
protected abstract String
generateUpdateRowString()
protected CollectionInitializer
getAppropriateInitializer(Serializable key, SessionImplementor session)
CollectionRegionAccessStrategy
getCacheAccessStrategy()
Get the cache
CacheEntryStructure
getCacheEntryStructure()
Get the cache structure
CollectionMetadata
getCollectionMetadata()
String[]
getCollectionPropertyColumnAliases(String propertyName, String suffix)
Serializable[]
getCollectionSpaces()
Get the "space" that holds the persistent state
CollectionType
getCollectionType()
Get the associated Type
protected ExecuteUpdateResultCheckStyle
getDeleteAllCheckStyle()
protected ExecuteUpdateResultCheckStyle
getDeleteCheckStyle()
protected Dialect
getDialect()
Object
getElementByIndex(Serializable key, Object index, SessionImplementor session, Object owner)
Class
getElementClass()
Return the element class of an array, or null otherwise
String[]
getElementColumnAliases(String suffix)
Generates the collection's element column aliases, based on the given suffix.
String[]
getElementColumnNames()
Get the names of the collection element columns (or the primary key columns in the case of a one-to-many association)
String[]
getElementColumnNames(String alias)
Get the names of the collection element columns (or the primary key columns in the case of a one-to-many association), aliased by the given table alias
String
getElementNodeName()
EntityPersister
getElementPersister()
Get the persister of the element class, if this is a collection of entities (optional operation).
Type
getElementType()
The collection element type
SessionFactoryImplementor
getFactory()
FetchMode
getFetchMode()
Should we load this collection role by outerjoining?
String
getIdentifierColumnAlias(String suffix)
Generates the collection's identifier column aliases, based on the given suffix.
String
getIdentifierColumnName()
IdentifierGenerator
getIdentifierGenerator()
Get the surrogate key generation strategy (optional operation)
Type
getIdentifierType()
Get the type of the surrogate key
String[]
getIndexColumnAliases(String suffix)
Generates the collection's index column aliases, based on the given suffix.
String[]
getIndexColumnNames()
Get the names of the collection index columns if this is an indexed collection (optional operation)
String[]
getIndexColumnNames(String alias)
Get the names of the collection index columns if this is an indexed collection (optional operation), aliased by the given table alias
String[]
getIndexFormulas()
Get the index formulas if this is an indexed collection (optional operation)
String
getIndexNodeName()
Type
getIndexType()
The collection index type (or null if the collection has no index)
protected ExecuteUpdateResultCheckStyle
getInsertCheckStyle()
String[]
getKeyColumnAliases(String suffix)
Generates the collection's key column aliases, based on the given suffix.
String[]
getKeyColumnNames()
The columns to join on
Type
getKeyType()
The collection key type
String
getManyToManyFilterFragment(String alias, Map enabledFilters)
String
getManyToManyOrderByString(String alias)
Get the order-by to be applied at the target table of a many to many
String
getName()
An identifying name; a class name or collection role name.
String
getNodeName()
String
getOwnerEntityName()
EntityPersister
getOwnerEntityPersister()
Get the persister of the entity that "owns" this collection
String
getRole()
The name of this collection role
protected String
getSQLDeleteRowString()
protected String
getSQLDeleteString()
protected SQLExceptionConverter
getSQLExceptionConverter()
protected String
getSQLInsertRowString()
String
getSQLOrderByString(String alias)
Get the order by SQL
protected String
getSQLUpdateRowString()
protected String
getSQLWhereString(String alias)
int
getSize(Serializable key, SessionImplementor session)
String
getTableName()
The table to join to.
Type
getType()
Get the type of the thing containing the properties
protected ExecuteUpdateResultCheckStyle
getUpdateCheckStyle()
boolean
hasCache()
Is this collection role cacheable
boolean
hasIndex()
Is this collection indexed?
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
hasWhere()
Does this collection role have a where clause filter?
protected Object
incrementIndexByBase(Object index)
boolean
indexExists(Serializable key, Object index, SessionImplementor session)
void
initCollectionPropertyMap()
void
initialize(Serializable key, SessionImplementor session)
Initialize the given collection with the given key
void
insertRows(PersistentCollection collection, Serializable id, SessionImplementor session)
Insert the persistent state of any new collection elements
boolean
isAffectedByEnabledFilters(SessionImplementor session)
boolean
isArray()
Is the collection an array?
boolean
isCollection()
Is this instance actually a CollectionPersister?
protected boolean
isDeleteAllCallable()
protected boolean
isDeleteCallable()
boolean
isExtraLazy()
protected boolean
isInsertCallable()
boolean
isInverse()
Is this collection "inverse", so state changes are not propogated to the database.
boolean
isLazy()
Is the collection lazily 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.
boolean
isMutable()
Can the elements of this collection change?
boolean
isPrimitiveArray()
Is the collection a primitive array?
protected boolean
isRowDeleteEnabled()
protected boolean
isRowInsertEnabled()
boolean
isSubselectLoadable()
protected boolean
isUpdateCallable()
boolean
isVersioned()
Does this collection cause version increment of the owning entity?
protected void
logStaticSQL()
String
oneToManyFilterFragment(String alias)
void
postInstantiate()
Object
readElement(ResultSet rs, Object owner, String[] aliases, SessionImplementor session)
Read the element from a row of the JDBC ResultSet
Object
readIdentifier(ResultSet rs, String alias, SessionImplementor session)
Read the identifier from a row of the JDBC ResultSet
Object
readIndex(ResultSet rs, String[] aliases, SessionImplementor session)
Read the index from a row of the JDBC ResultSet
Object
readKey(ResultSet rs, String[] aliases, SessionImplementor session)
Read the key from a row of the JDBC ResultSet
void
recreate(PersistentCollection collection, Serializable id, SessionImplementor session)
(Re)create the collection's persistent state
void
remove(Serializable id, SessionImplementor session)
Completely remove the persistent state of the collection
String
selectFragment(String alias, String columnSuffix)
Generate a list of collection index, key and element columns
String[]
toColumns(String propertyName)
Given a property path, return the corresponding column name(s).
String[]
toColumns(String alias, String propertyName)
Given a query alias and a property path, return the qualified column name
String
toString()
Type
toType(String propertyName)
Given a component path expression, get the type of the property
void
updateRows(PersistentCollection collection, Serializable id, SessionImplementor session)
Update the persistent state of any elements that were modified
protected int
writeElement(PreparedStatement st, Object elt, int i, SessionImplementor session)
Write the element to a JDBC PreparedStatement
protected int
writeElementToWhere(PreparedStatement st, Object elt, int i, SessionImplementor session)
Write the element to a JDBC PreparedStatement
int
writeIdentifier(PreparedStatement st, Object id, int i, SessionImplementor session)
Write the identifier to a JDBC PreparedStatement
protected int
writeIndex(PreparedStatement st, Object index, int i, SessionImplementor session)
Write the index to a JDBC PreparedStatement
protected int
writeIndexToWhere(PreparedStatement st, Object index, int i, SessionImplementor session)
Write the index to a JDBC PreparedStatement
protected int
writeKey(PreparedStatement st, Serializable key, int i, SessionImplementor session)
Write the key to a JDBC PreparedStatement

Field Details

batchSize

protected final int batchSize

elementColumnAliases

protected final String[] elementColumnAliases

elementColumnIsInPrimaryKey

protected final boolean[] elementColumnIsInPrimaryKey

elementColumnIsSettable

protected final boolean[] elementColumnIsSettable

elementColumnNames

protected final String[] elementColumnNames

elementFormulaTemplates

protected final String[] elementFormulaTemplates

elementFormulas

protected final String[] elementFormulas

elementIsPureFormula

protected final boolean elementIsPureFormula

elementType

protected final Type elementType

hasIdentifier

protected final boolean hasIdentifier

hasIndex

protected final boolean hasIndex

hasWhere

protected final boolean hasWhere

identifierColumnName

protected final String identifierColumnName

indexColumnAliases

protected final String[] indexColumnAliases

indexColumnIsSettable

protected final boolean[] indexColumnIsSettable

indexColumnNames

protected final String[] indexColumnNames

indexContainsFormula

protected final boolean indexContainsFormula

indexFormulaTemplates

protected final String[] indexFormulaTemplates

indexFormulas

protected final String[] indexFormulas

keyColumnAliases

protected final String[] keyColumnAliases

keyColumnNames

protected final String[] keyColumnNames

qualifiedTableName

protected final String qualifiedTableName

sqlWhereString

protected final String sqlWhereString

Constructor Details

AbstractCollectionPersister

public AbstractCollectionPersister(Collection collection,
                                   CollectionRegionAccessStrategy cacheAccessStrategy,
                                   Configuration cfg,
                                   SessionFactoryImplementor factory)
            throws MappingException,
                   CacheException

Method Details

appendElementColumns

protected void appendElementColumns(SelectFragment frag,
                                    String elemAlias)

appendIdentifierColumns

protected void appendIdentifierColumns(SelectFragment frag,
                                       String alias)

appendIndexColumns

protected void appendIndexColumns(SelectFragment frag,
                                  String alias)

createCollectionInitializer

protected abstract CollectionInitializer createCollectionInitializer(Map enabledFilters)
            throws MappingException

createSubselectInitializer

protected abstract CollectionInitializer createSubselectInitializer(SubselectFetch subselect,
                                                                    SessionImplementor session)

decrementIndexByBase

protected Object decrementIndexByBase(Object index)

deleteRows

public void deleteRows(PersistentCollection collection,
                       Serializable id,
                       SessionImplementor session)
            throws HibernateException
Delete the persistent state of any elements that were removed from the collection
Specified by:
deleteRows in interface CollectionPersister

doUpdateRows

protected abstract int doUpdateRows(Serializable key,
                                    PersistentCollection collection,
                                    SessionImplementor session)
            throws HibernateException

elementExists

public boolean elementExists(Serializable key,
                             Object element,
                             SessionImplementor session)
Specified by:
elementExists in interface CollectionPersister

filterFragment

protected String filterFragment(String alias)
            throws MappingException

filterFragment

public String filterFragment(String alias,
                             Map enabledFilters)
            throws MappingException
Get the where clause filter, given a query alias and considering enabled session filters
Specified by:
filterFragment in interface Joinable

generateDeleteRowString

protected abstract String generateDeleteRowString()

generateDeleteString

protected abstract String generateDeleteString()

generateDetectRowByElementString

protected String generateDetectRowByElementString()

generateDetectRowByIndexString

protected String generateDetectRowByIndexString()

generateInsertRowString

protected abstract String generateInsertRowString()

generateSelectFragment

protected SelectFragment generateSelectFragment(String alias,
                                                String columnSuffix)

generateSelectRowByIndexString

protected String generateSelectRowByIndexString()

generateSelectSizeString

protected String generateSelectSizeString(boolean isIntegerIndexed)

generateUpdateRowString

protected abstract String generateUpdateRowString()

getAppropriateInitializer

protected CollectionInitializer getAppropriateInitializer(Serializable key,
                                                          SessionImplementor session)

getCacheAccessStrategy

public CollectionRegionAccessStrategy getCacheAccessStrategy()
Get the cache
Specified by:
getCacheAccessStrategy in interface CollectionPersister

getCacheEntryStructure

public CacheEntryStructure getCacheEntryStructure()
Get the cache structure
Specified by:
getCacheEntryStructure in interface CollectionPersister

getCollectionMetadata

public CollectionMetadata getCollectionMetadata()
Specified by:
getCollectionMetadata in interface CollectionPersister

getCollectionPropertyColumnAliases

public String[] getCollectionPropertyColumnAliases(String propertyName,
                                                   String suffix)
Specified by:
getCollectionPropertyColumnAliases in interface SQLLoadableCollection

getCollectionSpaces

public Serializable[] getCollectionSpaces()
Get the "space" that holds the persistent state
Specified by:
getCollectionSpaces in interface CollectionPersister

getCollectionType

public CollectionType getCollectionType()
Get the associated Type
Specified by:
getCollectionType in interface CollectionPersister

getDeleteAllCheckStyle

protected ExecuteUpdateResultCheckStyle getDeleteAllCheckStyle()

getDeleteCheckStyle

protected ExecuteUpdateResultCheckStyle getDeleteCheckStyle()

getDialect

protected Dialect getDialect()

getElementByIndex

public Object getElementByIndex(Serializable key,
                                Object index,
                                SessionImplementor session,
                                Object owner)
Specified by:
getElementByIndex in interface CollectionPersister

getElementClass

public Class getElementClass()
Return the element class of an array, or null otherwise
Specified by:
getElementClass in interface CollectionPersister

getElementColumnAliases

public String[] getElementColumnAliases(String suffix)
Generates the collection's element column aliases, based on the given suffix.
Specified by:
getElementColumnAliases in interface CollectionPersister
Parameters:
suffix - The suffix to use in the element column alias generation.
Returns:
The key column aliases.

getElementColumnNames

public String[] getElementColumnNames()
Get the names of the collection element columns (or the primary key columns in the case of a one-to-many association)
Specified by:
getElementColumnNames in interface QueryableCollection

getElementColumnNames

public String[] getElementColumnNames(String alias)
Get the names of the collection element columns (or the primary key columns in the case of a one-to-many association), aliased by the given table alias
Specified by:
getElementColumnNames in interface QueryableCollection

getElementNodeName

public String getElementNodeName()
Specified by:
getElementNodeName in interface CollectionPersister

getElementPersister

public EntityPersister getElementPersister()
Get the persister of the element class, if this is a collection of entities (optional operation). Note that for a one-to-many association, the returned persister must be OuterJoinLoadable.
Specified by:
getElementPersister in interface QueryableCollection

getElementType

public Type getElementType()
The collection element type
Specified by:
getElementType in interface CollectionMetadata
getElementType in interface CollectionPersister

getFactory

public SessionFactoryImplementor getFactory()
Specified by:
getFactory in interface CollectionPersister

getFetchMode

public FetchMode getFetchMode()
Should we load this collection role by outerjoining?
Specified by:
getFetchMode in interface QueryableCollection

getIdentifierColumnAlias

public String getIdentifierColumnAlias(String suffix)
Generates the collection's identifier column aliases, based on the given suffix.
Specified by:
getIdentifierColumnAlias in interface CollectionPersister
Parameters:
suffix - The suffix to use in the key column alias generation.
Returns:
The key column aliases.

getIdentifierColumnName

public String getIdentifierColumnName()
Specified by:
getIdentifierColumnName in interface SQLLoadableCollection

getIdentifierGenerator

public IdentifierGenerator getIdentifierGenerator()
Get the surrogate key generation strategy (optional operation)
Specified by:
getIdentifierGenerator in interface CollectionPersister

getIdentifierType

public Type getIdentifierType()
Get the type of the surrogate key
Specified by:
getIdentifierType in interface CollectionPersister

getIndexColumnAliases

public String[] getIndexColumnAliases(String suffix)
Generates the collection's index column aliases, based on the given suffix.
Specified by:
getIndexColumnAliases in interface CollectionPersister
Parameters:
suffix - The suffix to use in the index column alias generation.
Returns:
The key column aliases, or null if not indexed.

getIndexColumnNames

public String[] getIndexColumnNames()
Get the names of the collection index columns if this is an indexed collection (optional operation)
Specified by:
getIndexColumnNames in interface QueryableCollection

getIndexColumnNames

public String[] getIndexColumnNames(String alias)
Get the names of the collection index columns if this is an indexed collection (optional operation), aliased by the given table alias
Specified by:
getIndexColumnNames in interface QueryableCollection

getIndexFormulas

public String[] getIndexFormulas()
Get the index formulas if this is an indexed collection (optional operation)
Specified by:
getIndexFormulas in interface QueryableCollection

getIndexNodeName

public String getIndexNodeName()
Specified by:
getIndexNodeName in interface CollectionPersister

getIndexType

public Type getIndexType()
The collection index type (or null if the collection has no index)
Specified by:
getIndexType in interface CollectionMetadata
getIndexType in interface CollectionPersister

getInsertCheckStyle

protected ExecuteUpdateResultCheckStyle getInsertCheckStyle()

getKeyColumnAliases

public String[] getKeyColumnAliases(String suffix)
Generates the collection's key column aliases, based on the given suffix.
Specified by:
getKeyColumnAliases in interface CollectionPersister
Parameters:
suffix - The suffix to use in the key column alias generation.
Returns:
The key column aliases.

getKeyColumnNames

public String[] getKeyColumnNames()
The columns to join on
Specified by:
getKeyColumnNames in interface Joinable

getKeyType

public Type getKeyType()
The collection key type
Specified by:
getKeyType in interface CollectionMetadata
getKeyType in interface CollectionPersister

getManyToManyFilterFragment

public String getManyToManyFilterFragment(String alias,
                                          Map enabledFilters)
Specified by:
getManyToManyFilterFragment in interface CollectionPersister

getManyToManyOrderByString

public String getManyToManyOrderByString(String alias)
Get the order-by to be applied at the target table of a many to many
Specified by:
getManyToManyOrderByString in interface QueryableCollection
Parameters:
alias - The alias for the many-to-many target table
Returns:
appropriate order-by fragment or empty string.

getName

public String getName()
An identifying name; a class name or collection role name.
Specified by:
getName in interface Joinable

getNodeName

public String getNodeName()
Specified by:
getNodeName in interface CollectionPersister

getOwnerEntityName

public String getOwnerEntityName()

getOwnerEntityPersister

public EntityPersister getOwnerEntityPersister()
Get the persister of the entity that "owns" this collection
Specified by:
getOwnerEntityPersister in interface CollectionPersister

getRole

public String getRole()
The name of this collection role
Specified by:
getRole in interface CollectionMetadata
getRole in interface CollectionPersister

getSQLDeleteRowString

protected String getSQLDeleteRowString()

getSQLDeleteString

protected String getSQLDeleteString()

getSQLExceptionConverter

protected SQLExceptionConverter getSQLExceptionConverter()

getSQLInsertRowString

protected String getSQLInsertRowString()

getSQLOrderByString

public String getSQLOrderByString(String alias)
Get the order by SQL
Specified by:
getSQLOrderByString in interface QueryableCollection

getSQLUpdateRowString

protected String getSQLUpdateRowString()

getSQLWhereString

protected String getSQLWhereString(String alias)

getSize

public int getSize(Serializable key,
                   SessionImplementor session)
Specified by:
getSize in interface CollectionPersister

getTableName

public String getTableName()
The table to join to.
Specified by:
getTableName in interface Joinable

getType

public Type getType()
Get the type of the thing containing the properties
Specified by:
getType in interface PropertyMapping

getUpdateCheckStyle

protected ExecuteUpdateResultCheckStyle getUpdateCheckStyle()

hasCache

public boolean hasCache()
Is this collection role cacheable
Specified by:
hasCache in interface CollectionPersister

hasIndex

public boolean hasIndex()
Is this collection indexed?
Specified by:
hasIndex in interface CollectionMetadata
hasIndex in interface CollectionPersister

hasManyToManyOrdering

public boolean hasManyToManyOrdering()
Specified by:
hasManyToManyOrdering in interface CollectionPersister

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.)
Specified by:
hasOrdering in interface CollectionPersister

hasOrphanDelete

public boolean hasOrphanDelete()
Does this collection implement "orphan delete"?
Specified by:
hasOrphanDelete in interface CollectionPersister

hasWhere

public boolean hasWhere()
Does this collection role have a where clause filter?
Specified by:
hasWhere in interface QueryableCollection

incrementIndexByBase

protected Object incrementIndexByBase(Object index)

indexExists

public boolean indexExists(Serializable key,
                           Object index,
                           SessionImplementor session)
Specified by:
indexExists in interface CollectionPersister

initCollectionPropertyMap

public void initCollectionPropertyMap()

initialize

public void initialize(Serializable key,
                       SessionImplementor session)
            throws HibernateException
Initialize the given collection with the given key
Specified by:
initialize in interface CollectionPersister

insertRows

public void insertRows(PersistentCollection collection,
                       Serializable id,
                       SessionImplementor session)
            throws HibernateException
Insert the persistent state of any new collection elements
Specified by:
insertRows in interface CollectionPersister

isAffectedByEnabledFilters

public boolean isAffectedByEnabledFilters(SessionImplementor session)
Specified by:
isAffectedByEnabledFilters in interface CollectionPersister

isArray

public boolean isArray()
Is the collection an array?
Specified by:
isArray in interface CollectionMetadata
isArray in interface CollectionPersister

isCollection

public boolean isCollection()
Is this instance actually a CollectionPersister?
Specified by:
isCollection in interface Joinable

isDeleteAllCallable

protected boolean isDeleteAllCallable()

isDeleteCallable

protected boolean isDeleteCallable()

isExtraLazy

public boolean isExtraLazy()
Specified by:
isExtraLazy in interface CollectionPersister

isInsertCallable

protected boolean isInsertCallable()

isInverse

public boolean isInverse()
Is this collection "inverse", so state changes are not propogated to the database.
Specified by:
isInverse in interface CollectionPersister

isLazy

public boolean isLazy()
Is the collection lazily initialized?
Specified by:
isLazy in interface CollectionMetadata
isLazy in interface CollectionPersister

isManyToMany

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.
Specified by:
isManyToMany in interface CollectionPersister

isMutable

public boolean isMutable()
Can the elements of this collection change?
Specified by:
isMutable in interface CollectionPersister

isPrimitiveArray

public boolean isPrimitiveArray()
Is the collection a primitive array?
Specified by:
isPrimitiveArray in interface CollectionMetadata
isPrimitiveArray in interface CollectionPersister

isRowDeleteEnabled

protected boolean isRowDeleteEnabled()

isRowInsertEnabled

protected boolean isRowInsertEnabled()

isSubselectLoadable

public boolean isSubselectLoadable()

isUpdateCallable

protected boolean isUpdateCallable()

isVersioned

public boolean isVersioned()
Does this collection cause version increment of the owning entity?
Specified by:
isVersioned in interface CollectionPersister

logStaticSQL

protected void logStaticSQL()

oneToManyFilterFragment

public String oneToManyFilterFragment(String alias)
            throws MappingException
Specified by:
oneToManyFilterFragment in interface Joinable

postInstantiate

public void postInstantiate()
            throws MappingException
Specified by:
postInstantiate in interface CollectionPersister

readElement

public Object readElement(ResultSet rs,
                          Object owner,
                          String[] aliases,
                          SessionImplementor session)
            throws HibernateException,
                   SQLException
Read the element from a row of the JDBC ResultSet
Specified by:
readElement in interface CollectionPersister

readIdentifier

public Object readIdentifier(ResultSet rs,
                             String alias,
                             SessionImplementor session)
            throws HibernateException,
                   SQLException
Read the identifier from a row of the JDBC ResultSet
Specified by:
readIdentifier in interface CollectionPersister

readIndex

public Object readIndex(ResultSet rs,
                        String[] aliases,
                        SessionImplementor session)
            throws HibernateException,
                   SQLException
Read the index from a row of the JDBC ResultSet
Specified by:
readIndex in interface CollectionPersister

readKey

public Object readKey(ResultSet rs,
                      String[] aliases,
                      SessionImplementor session)
            throws HibernateException,
                   SQLException
Read the key from a row of the JDBC ResultSet
Specified by:
readKey in interface CollectionPersister

recreate

public void recreate(PersistentCollection collection,
                     Serializable id,
                     SessionImplementor session)
            throws HibernateException
(Re)create the collection's persistent state
Specified by:
recreate in interface CollectionPersister

remove

public void remove(Serializable id,
                   SessionImplementor session)
            throws HibernateException
Completely remove the persistent state of the collection
Specified by:
remove in interface CollectionPersister

selectFragment

public String selectFragment(String alias,
                             String columnSuffix)
Generate a list of collection index, key and element columns
Specified by:
selectFragment in interface QueryableCollection

toColumns

public String[] toColumns(String propertyName)
            throws QueryException
Given a property path, return the corresponding column name(s).
Specified by:
toColumns in interface PropertyMapping

toColumns

public String[] toColumns(String alias,
                          String propertyName)
            throws QueryException
Given a query alias and a property path, return the qualified column name
Specified by:
toColumns in interface PropertyMapping

toString

public String toString()

toType

public Type toType(String propertyName)
            throws QueryException
Given a component path expression, get the type of the property
Specified by:
toType in interface PropertyMapping

updateRows

public void updateRows(PersistentCollection collection,
                       Serializable id,
                       SessionImplementor session)
            throws HibernateException
Update the persistent state of any elements that were modified
Specified by:
updateRows in interface CollectionPersister

writeElement

protected int writeElement(PreparedStatement st,
                           Object elt,
                           int i,
                           SessionImplementor session)
            throws HibernateException,
                   SQLException
Write the element to a JDBC PreparedStatement

writeElementToWhere

protected int writeElementToWhere(PreparedStatement st,
                                  Object elt,
                                  int i,
                                  SessionImplementor session)
            throws HibernateException,
                   SQLException
Write the element to a JDBC PreparedStatement

writeIdentifier

public int writeIdentifier(PreparedStatement st,
                           Object id,
                           int i,
                           SessionImplementor session)
            throws HibernateException,
                   SQLException
Write the identifier to a JDBC PreparedStatement

writeIndex

protected int writeIndex(PreparedStatement st,
                         Object index,
                         int i,
                         SessionImplementor session)
            throws HibernateException,
                   SQLException
Write the index to a JDBC PreparedStatement

writeIndexToWhere

protected int writeIndexToWhere(PreparedStatement st,
                                Object index,
                                int i,
                                SessionImplementor session)
            throws HibernateException,
                   SQLException
Write the index to a JDBC PreparedStatement

writeKey

protected int writeKey(PreparedStatement st,
                       Serializable key,
                       int i,
                       SessionImplementor session)
            throws HibernateException,
                   SQLException
Write the key to a JDBC PreparedStatement