Top Description 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.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, org.hibernate.AssertionFailure, .FetchMode, .HibernateException, .MappingException, .QueryException, .TransientObjectException, org.hibernate.cache.CacheException, org.hibernate.cache.access.CollectionRegionAccessStrategy, org.hibernate.cache.entry.CacheEntryStructure, .StructuredCollectionCacheEntry, .StructuredMapCacheEntry, .UnstructuredCacheEntry, org.hibernate.cfg.Configuration, org.hibernate.collection.PersistentCollection, org.hibernate.dialect.Dialect, org.hibernate.engine.EntityKey, .ExecuteUpdateResultCheckStyle, .LoadQueryInfluencers, .PersistenceContext, .SessionFactoryImplementor, .SessionImplementor, .SubselectFetch, org.hibernate.exception.JDBCExceptionHelper, .SQLExceptionConverter, org.hibernate.id.IdentifierGenerator, 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.persister.entity.EntityPersister, .Loadable, .PropertyMapping, org.hibernate.pretty.MessageHelper, org.hibernate.sql.Alias, .SelectFragment, .SimpleSelect, .Template, org.hibernate.sql.ordering.antlr.ColumnMapper, org.hibernate.type.CollectionType, .CompositeType, .EntityType, .Type, org.hibernate.util.ArrayHelper, .FilterHelper, .StringHelper, org.slf4j.Logger, .LoggerFactory

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

Field Summary

Modifier and TypeField and Description
private final int
protected final int
private final CollectionRegionAccessStrategy
private final CacheEntryStructure
private Map<K, V>
private Map<K, V>
private final CollectionType
private final boolean
private ExecuteUpdateResultCheckStyle
private final boolean
private ExecuteUpdateResultCheckStyle
private final Dialect
private final Class<T>
protected final String[]
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 String
private final EntityPersister
private final PropertyMapping
protected final Type
private final String
private final SessionFactoryImplementor
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
private final Type
protected final String[]
protected final boolean[]
protected final String[]
protected final boolean
protected final String[]
protected final String[]
private String[]
private final String
private final Type
private CollectionInitializer
private final boolean
private ExecuteUpdateResultCheckStyle
private final boolean
private final boolean
private 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 Logger
private final FilterHelper
private final String
private final String
private final String
private final String
private final EntityPersister
protected final String
private final String
private final String
private final Serializable[]
private final String
private final String
private final String
private final String
private final SQLExceptionConverter
private final String
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(final Collection collection, final CollectionRegionAccessStrategy cacheAccessStrategy, final Configuration cfg, final SessionFactoryImplementor factory)

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
protected void
protected abstract CollectionInitializer
protected abstract CollectionInitializer
protected Object
public void
deleteRows(PersistentCollection collection, Serializable id, SessionImplementor session)

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

Delete the persistent state of any elements that were removed from the collection
protected abstract int
public boolean
private boolean
exists(Serializable key, Object indexOrElement, Type indexOrElementType, String sql, SessionImplementor session)

protected String
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
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 CollectionRegionAccessStrategy
public CacheEntryStructure
public CollectionMetadata
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 String
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 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.

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

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

Get the index formulas if this is an indexed collection (optional operation)
public String
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
getName()

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

An identifying name; a class name or collection role name.
public String
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 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, SessionImplementor session)

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

Initialize the given collection with the given key
public void
insertRows(PersistentCollection collection, Serializable id, SessionImplementor 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 propogated 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 void
private static String[]
qualify(String alias, String[] columnNames, String[] formulaTemplates)

public Object
readElement(ResultSet rs, Object owner, String[] aliases, SessionImplementor 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, SessionImplementor 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, SessionImplementor 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, SessionImplementor session)

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

Read the key from a row of the JDBC ResultSet
public void
recreate(PersistentCollection collection, Serializable id, SessionImplementor session)

Implements org.hibernate.persister.collection.CollectionPersister.recreate.

(Re)create the collection's persistent state
public void
remove(Serializable id, SessionImplementor 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.

Given a query alias and a property path, return the qualified column name
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, SessionImplementor 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, 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

public 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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait