Top Description Inners Fields Constructors Methods
org.hibernate.persister.collection

public abstract Class AbstractCollectionPersister

extends Object
implements CollectionMetadata, SQLLoadableCollection
Class Inheritance
All Implemented Interfaces
org.hibernate.persister.collection.SQLLoadableCollection, org.hibernate.persister.collection.QueryableCollection, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.walking.spi.CollectionDefinition, org.hibernate.persister.entity.Joinable, org.hibernate.persister.entity.PropertyMapping, org.hibernate.metadata.CollectionMetadata
Known Direct Subclasses
org.hibernate.persister.collection.BasicCollectionPersister, org.hibernate.persister.collection.OneToManyPersister
Imports
java.io.Serializable, java.sql.PreparedStatement, .ResultSet, .SQLException, java.util.Arrays, .HashMap, .Iterator, .Map, .Set, org.hibernate.AssertionFailure, .FetchMode, .Filter, .HibernateException, .MappingException, .QueryException, .TransientObjectException, org.hibernate.boot.model.relational.Database, org.hibernate.cache.CacheException, org.hibernate.cache.spi.access.CollectionDataAccess, org.hibernate.cache.spi.entry.CacheEntryStructure, .StructuredCollectionCacheEntry, .StructuredMapCacheEntry, .UnstructuredCacheEntry, org.hibernate.collection.spi.PersistentCollection, org.hibernate.dialect.Dialect, org.hibernate.engine.jdbc.batch.internal.BasicBatchKey, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment, org.hibernate.engine.jdbc.spi.JdbcCoordinator, .SqlExceptionHelper, org.hibernate.engine.spi.EntityKey, .ExecuteUpdateResultCheckStyle, .LoadQueryInfluencers, .PersistenceContext, .SessionFactoryImplementor, .SharedSessionContractImplementor, .SubselectFetch, org.hibernate.exception.spi.SQLExceptionConverter, org.hibernate.id.IdentifierGenerator, org.hibernate.internal.CoreMessageLogger, .FilterAliasGenerator, .FilterHelper, org.hibernate.internal.util.StringHelper, org.hibernate.internal.util.collections.ArrayHelper, org.hibernate.jdbc.Expectation, .Expectations, org.hibernate.loader.collection.CollectionInitializer, org.hibernate.mapping.Collection, .Column, .Formula, .IdentifierCollection, .IndexedCollection, .List, .Selectable, .Table, org.hibernate.metadata.CollectionMetadata, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.persister.entity.EntityPersister, .Loadable, .PropertyMapping, .Queryable, org.hibernate.persister.spi.PersisterCreationContext, org.hibernate.persister.walking.internal.CompositionSingularSubAttributesHelper, .StandardAnyTypeDefinition, org.hibernate.persister.walking.spi.AnyMappingDefinition, .AttributeDefinition, .AttributeSource, .CollectionDefinition, .CollectionElementDefinition, .CollectionIndexDefinition, .CompositeCollectionElementDefinition, .CompositionDefinition, .EntityDefinition, org.hibernate.pretty.MessageHelper, org.hibernate.sql.Alias, .Insert, .Update, .Delete, .SelectFragment, .SimpleSelect, .Template, org.hibernate.sql.ordering.antlr.ColumnMapper, .ColumnReference, .FormulaReference, .OrderByAliasResolver, .OrderByTranslation, .SqlValueReference, org.hibernate.type.AnyType, .AssociationType, .CollectionType, .CompositeType, .EntityType, .Type, org.jboss.logging.Logger

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private final int
protected final int
private final CollectionDataAccess
private final CacheEntryStructure
private Map<K, V>
private final CollectionType
private final boolean
private ExecuteUpdateResultCheckStyle
private BasicBatchKey
private final boolean
private ExecuteUpdateResultCheckStyle
private final Dialect
private final Class<T>
protected final String[]
protected final boolean[]
protected final boolean[]
protected final boolean[]
protected final String[]
protected final String[]
protected final String[]
protected final String[]
protected final String[]
protected final String[]
protected final boolean
private final EntityPersister
private final PropertyMapping
protected final Type
private final String
private final SessionFactoryImplementor
factory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
private final FetchMode
private final FilterHelper
protected final boolean
protected final boolean
private final boolean
private final boolean
private final boolean
protected final boolean
private final String
protected final String
private final IdentifierGenerator
identifierGenerator

Deprecated as a consequence of IdentifierGenerator being deprecated.
private final Type
protected final String[]
protected final boolean[]
protected final boolean[]
protected final String[]
protected final boolean
protected final String[]
protected final String[]
private String[]
private final Type
private CollectionInitializer
private BasicBatchKey
private final boolean
private ExecuteUpdateResultCheckStyle
private final boolean
private final boolean
protected final boolean
private final boolean
private final boolean
private final boolean
private final boolean
protected final String[]
protected final String[]
private final Type
private static final CoreMessageLogger
private final FilterHelper
private final OrderByTranslation
private final String
private final String
private String
private final OrderByTranslation
private final EntityPersister
protected final String
private final String
protected BasicBatchKey
private BasicBatchKey
private final Serializable[]
private final String
private final String
private final String
private final String
protected final SqlExceptionHelper
private final String
private final String
private final String
private final String
protected final String
private final String
private final boolean
private final boolean
private ExecuteUpdateResultCheckStyle

Constructor Summary

AccessConstructor and Description
public
AbstractCollectionPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext)

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
protected void
protected abstract CollectionInitializer
protected Delete
protected Insert
protected abstract CollectionInitializer
protected Update
protected Object
public void
deleteRows(PersistentCollection collection, Serializable id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.deleteRows.

Delete the persistent state of any elements that were removed from the collection
protected String
determineTableName(Table table)

Deprecated as a consequence of Table being deprecated.
protected void
doProcessQueuedOps(PersistentCollection
The collection
collection
,
Serializable
The collection key
key
,
int
The next index to write
nextIndex
,
SharedSessionContractImplementor
The session
session
)

Process queued operations within the PersistentCollection.
protected abstract void
protected abstract int
public boolean
private boolean
exists(Serializable key, Object indexOrElement, Type indexOrElementType, String sql, SharedSessionContractImplementor session)

protected String
protected String
filterFragment(String alias, Set<String> treatAsDeclarations)

public String
filterFragment(String alias, Map<K, V> enabledFilters)

Implements org.hibernate.persister.entity.Joinable.filterFragment.

Get the where clause filter, given a query alias and considering enabled session filters
public String
filterFragment(String alias, Map<K, V> enabledFilters, Set<String> treatAsDeclarations)

Implements org.hibernate.persister.entity.Joinable.filterFragment.

Get the where clause filter, given a query alias and considering enabled session filters
private String[]
formulaTemplates(String reference, int expectedSize)

protected abstract String
protected abstract String
protected String
protected String
protected abstract String
protected SelectFragment
generateSelectFragment(String alias, String columnSuffix)

protected String
protected String
generateSelectSizeString(boolean isIntegerIndexed)

protected abstract String
protected CollectionInitializer
public int
public CollectionDataAccess
public CacheEntryStructure
public CollectionMetadata
public CollectionPersister
public String[]
public Serializable[]
getCollectionSpaces()

Implements org.hibernate.persister.collection.CollectionPersister.getCollectionSpaces.

Get the "space" that holds the persistent state
public CollectionType
protected ExecuteUpdateResultCheckStyle
protected ExecuteUpdateResultCheckStyle
protected Dialect
public Object
public Class<T>
getElementClass()

Implements org.hibernate.persister.collection.CollectionPersister.getElementClass.

Return the element class of an array, or null otherwise.
public String[]
getElementColumnAliases(String
The suffix to use in the element column alias generation.
suffix
)

Implements org.hibernate.persister.collection.CollectionPersister.getElementColumnAliases.

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

Implements org.hibernate.persister.collection.QueryableCollection.getElementColumnNames.

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
public String[]
getElementColumnNames()

Implements org.hibernate.persister.collection.QueryableCollection.getElementColumnNames.

Get the names of the collection element columns (or the primary key columns in the case of a one-to-many association)
public CollectionElementDefinition
public EntityPersister
getElementPersister()

Implements org.hibernate.persister.collection.QueryableCollection.getElementPersister.

Get the persister of the element class, if this is a collection of entities (optional operation).
public Type
public SessionFactoryImplementor
public FetchMode
getFetchMode()

Implements org.hibernate.persister.collection.QueryableCollection.getFetchMode.

Should we load this collection role by outerjoining?
public abstract FilterAliasGenerator
public String
getIdentifierColumnAlias(String
The suffix to use in the key column alias generation.
suffix
)

Implements org.hibernate.persister.collection.CollectionPersister.getIdentifierColumnAlias.

Generates the collection's identifier column aliases, based on the given suffix.
public String
public IdentifierGenerator
getIdentifierGenerator()

Implements org.hibernate.persister.collection.CollectionPersister.getIdentifierGenerator.

Deprecated as a consequence of IdentifierGenerator being deprecated.
Get the surrogate key generation strategy (optional operation)
public Type
public String[]
getIndexColumnAliases(String
The suffix to use in the index column alias generation.
suffix
)

Implements org.hibernate.persister.collection.CollectionPersister.getIndexColumnAliases.

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

Implements org.hibernate.persister.collection.QueryableCollection.getIndexColumnNames.

Get the names of the collection index columns if this is an indexed collection (optional operation)
public String[]
getIndexColumnNames(String alias)

Implements org.hibernate.persister.collection.QueryableCollection.getIndexColumnNames.

Get the names of the collection index columns if this is an indexed collection (optional operation), aliased by the given table alias
public CollectionIndexDefinition
public String[]
getIndexFormulas()

Implements org.hibernate.persister.collection.QueryableCollection.getIndexFormulas.

Get the index formulas if this is an indexed collection (optional operation)
public Type
public CollectionInitializer

Returns:

The default collection initializer for this persister/collection.
getInitializer
()

Intended for internal use only.

protected ExecuteUpdateResultCheckStyle
public String[]
getKeyColumnAliases(String
The suffix to use in the key column alias generation.
suffix
)

Implements org.hibernate.persister.collection.CollectionPersister.getKeyColumnAliases.

Generates the collection's key column aliases, based on the given suffix.
public String[]
public Type
public String
public String
getManyToManyOrderByString(String
The alias for the many-to-many target table
alias
)

Implements org.hibernate.persister.collection.QueryableCollection.getManyToManyOrderByString.

Get the order-by to be applied at the target table of a many to many
public String
public String
getName()

Implements org.hibernate.persister.entity.Joinable.getName.

An identifying name; a class name or collection role name.
public NavigableRole
public String
public EntityPersister
getOwnerEntityPersister()

Implements org.hibernate.persister.collection.CollectionPersister.getOwnerEntityPersister.

Get the persister of the entity that "owns" this collection
public String
public int
protected String
protected String
protected SQLExceptionConverter
protected SqlExceptionHelper
protected String
public String
protected String
protected String
private CollectionInitializer
public String
public Type
getType()

Implements org.hibernate.persister.entity.PropertyMapping.getType.

Get the type of the thing containing the properties
protected ExecuteUpdateResultCheckStyle
public boolean
hasCache()

Implements org.hibernate.persister.collection.CollectionPersister.hasCache.

Is this collection role cacheable
public boolean
public boolean
public boolean
public boolean
hasOrphanDelete()

Implements org.hibernate.persister.collection.CollectionPersister.hasOrphanDelete.

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

Implements org.hibernate.persister.collection.QueryableCollection.hasWhere.

Does this collection role have a where clause filter?
protected Object
public boolean
public void
private void
initCollectionPropertyMap(String aliasName, Type type, String[] columnAliases, String[] columnNames)

public void
initialize(Serializable key, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.initialize.

Initialize the given collection with the given key TODO: add owner argument!!
public void
insertRows(PersistentCollection collection, Serializable id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.insertRows.

Insert the persistent state of any new collection elements
public boolean
public boolean
public boolean
isCollection()

Implements org.hibernate.persister.entity.Joinable.isCollection.

Is this instance actually a CollectionPersister?
protected boolean
protected boolean
public boolean
protected boolean
public boolean
isInverse()

Implements org.hibernate.persister.collection.CollectionPersister.isInverse.

Is this collection "inverse", so state changes are not propagated to the database.
public boolean
public abstract boolean
public boolean
isMutable()

Implements org.hibernate.persister.collection.CollectionPersister.isMutable.

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

Implements org.hibernate.persister.collection.CollectionPersister.isVersioned.

Does this collection cause version increment of the owning entity?
protected void
public String
public String
public void
public void
processQueuedOps(PersistentCollection collection, Serializable key, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.processQueuedOps.

Process queued operations within the PersistentCollection.
private static String[]
qualify(String alias, String[] columnNames, String[] formulaTemplates)

public Object
readElement(ResultSet rs, Object owner, String[] aliases, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.readElement.

Read the element from a row of the JDBC ResultSet
public Object
readIdentifier(ResultSet rs, String alias, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.readIdentifier.

Read the identifier from a row of the JDBC ResultSet
public Object
readIndex(ResultSet rs, String[] aliases, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.readIndex.

Read the index from a row of the JDBC ResultSet
public Object
readKey(ResultSet rs, String[] aliases, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.readKey.

Read the key from a row of the JDBC ResultSet
public void
public void
remove(Serializable id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.remove.

Completely remove the persistent state of the collection
public String
selectFragment(String alias, String columnSuffix)

Implements org.hibernate.persister.collection.QueryableCollection.selectFragment.

Generate a list of collection index, key and element columns
public String[]
toColumns(String alias, String propertyName)

Implements org.hibernate.persister.entity.PropertyMapping.toColumns.

Obtain aliased column/formula fragments for the specified property path.
public String[]
toColumns(String propertyName)

Implements org.hibernate.persister.entity.PropertyMapping.toColumns.

Given a property path, return the corresponding column name(s).
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public Type
toType(String propertyName)

Implements org.hibernate.persister.entity.PropertyMapping.toType.

Given a component path expression, get the type of the property
public void
updateRows(PersistentCollection collection, Serializable id, SharedSessionContractImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.updateRows.

Update the persistent state of any elements that were modified
protected int
writeElement(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session)

Write the element to a JDBC PreparedStatement

protected int
writeElementToWhere(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session)

Write the element to a JDBC PreparedStatement

public int
writeIdentifier(PreparedStatement st, Object id, int i, SharedSessionContractImplementor session)

Write the identifier to a JDBC PreparedStatement

protected int
writeIndex(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session)

Write the index to a JDBC PreparedStatement

protected int
writeIndexToWhere(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session)

Write the index to a JDBC PreparedStatement

protected int
writeKey(PreparedStatement st, Serializable key, int i, SharedSessionContractImplementor session)

Write the key to a JDBC PreparedStatement

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait