Class AbstractCollectionPersister
- java.lang.Object
-
- org.hibernate.persister.collection.AbstractCollectionPersister
-
- All Implemented Interfaces:
CollectionMetadata,FilterRestrictable,PluralAttributeMappingImpl.Aware,Restrictable,WhereRestrictable,CollectionPersister,QueryableCollection,SQLLoadableCollection,Joinable,PropertyMapping
- Direct Known Subclasses:
BasicCollectionPersister,OneToManyPersister
public abstract class AbstractCollectionPersister extends Object implements CollectionMetadata, SQLLoadableCollection, PluralAttributeMappingImpl.Aware
Base implementation of theQueryableCollectioninterface.- See Also:
BasicCollectionPersister,OneToManyPersister
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AbstractCollectionPersister(Collection collectionBootDescriptor, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext)AbstractCollectionPersister(Collection collectionBootDescriptor, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext)Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidapplyBaseManyToManyRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)voidapplyBaseRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)Applies the base set of restrictions.voidapplyFilterRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, SqlAstCreationState creationState)Applies just theFiltervalues enabled for the associated entityprotected voidapplyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState astCreationState)voidapplyWhereRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, SqlAstCreationState creationState)Apply theWhererestrictionsprotected CollectionLoadercreateCollectionLoader(LoadQueryInfluencers loadQueryInfluencers)protected DeletecreateDelete()protected InsertcreateInsert()protected CollectionLoadercreateSubSelectLoader(SubselectFetch subselect, SharedSessionContractImplementor session)protected UpdatecreateUpdate()protected ObjectdecrementIndexByBase(Object index)voiddeleteRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)Delete the persistent state of any elements that were removed from the collectionprotected CollectionLoaderdetermineLoaderToUse(Object key, SharedSessionContractImplementor session)protected StringdetermineTableName(Table table)protected abstract voiddoProcessQueuedOps(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)protected abstract intdoUpdateRows(Object key, PersistentCollection<?> collection, SharedSessionContractImplementor session)booleanelementExists(Object key, Object element, SharedSessionContractImplementor session)protected abstract StringgenerateDeleteRowString()protected abstract StringgenerateDeleteString()protected StringgenerateDetectRowByElementString()protected StringgenerateDetectRowByIndexString()protected abstract StringgenerateInsertRowString()protected StringgenerateSelectSizeString(boolean isIntegerIndexed)protected abstract StringgenerateUpdateRowString()PluralAttributeMappinggetAttributeMapping()intgetBatchSize()CollectionDataAccessgetCacheAccessStrategy()Get the cacheCacheEntryStructuregetCacheEntryStructure()Get the cache structureCollectionMetadatagetCollectionMetadata()Deprecated.String[]getCollectionPropertyColumnAliases(String propertyName, String suffix)CollectionSemantics<?,?>getCollectionSemantics()Serializable[]getCollectionSpaces()Get the "space" that holds the persistent stateCollectionTypegetCollectionType()Get the associatedTypeprotected ExecuteUpdateResultCheckStylegetDeleteAllCheckStyle()protected ExecuteUpdateResultCheckStylegetDeleteCheckStyle()protected DialectgetDialect()ObjectgetElementByIndex(Object key, Object index, SharedSessionContractImplementor 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 aliasBasicValueConverter<?,?>getElementConverter()The value converter for the element values of this collectionEntityPersistergetElementPersister()Get the persister of the element class, if this is a collection of entities (optional operation).protected EntityPersistergetElementPersisterInternal()TypegetElementType()The collection element typeSessionFactoryImplementorgetFactory()FetchModegetFetchMode()Should we load this collection role by outerjoining?abstract FilterAliasGeneratorgetFilterAliasGenerator(String rootAlias)abstract FilterAliasGeneratorgetFilterAliasGenerator(TableGroup tableGroup)StringgetIdentifierColumnAlias(String suffix)Generates the collection's identifier column aliases, based on the given suffix.StringgetIdentifierColumnName()IdentifierGeneratorgetIdentifierGenerator()Get the surrogate key generation strategy (optional operation)TypegetIdentifierType()Get the type of the surrogate keyString[]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 aliasBasicValueConverter<?,?>getIndexConverter()The value converter for index values of this collection (effectively map keys only)String[]getIndexFormulas()Get the index formulas if this is an indexed collection (optional operation)TypegetIndexType()The collection index type (or null if the collection has no index)protected ExecuteUpdateResultCheckStylegetInsertCheckStyle()String[]getKeyColumnAliases(String suffix)Generates the collection's key column aliases, based on the given suffix.String[]getKeyColumnNames()The columns to join onTypegetKeyType()The collection key typeStringgetManyToManyFilterFragment(TableGroup tableGroup, Map<String,Filter> enabledFilters)StringgetManyToManyOrderByString(String alias)Get the order-by to be applied at the target table of a many to manyStringgetMappedByProperty()StringgetName()An identifying name; a class name or collection role name.NavigableRolegetNavigableRole()StringgetOwnerEntityName()EntityPersistergetOwnerEntityPersister()Get the persister of the entity that "owns" this collectionStringgetRole()The name of this collection roleintgetSize(Object key, SharedSessionContractImplementor session)Comparator<?>getSortingComparator()For sorted collections, the comparator to use.protected StringgetSQLDeleteRowString()protected StringgetSQLDeleteString()protected SQLExceptionConvertergetSQLExceptionConverter()protected SqlExceptionHelpergetSQLExceptionHelper()protected StringgetSQLInsertRowString()StringgetSQLOrderByString(String alias)Get the order by SQLprotected StringgetSQLUpdateRowString()protected CollectionLoadergetStandardCollectionLoader()StringgetTableName()The table to join to.protected ExecuteUpdateResultCheckStylegetUpdateCheckStyle()booleanhasCache()Is this collection role cacheablebooleanhasIndex()Is this collection indexed?booleanhasManyToManyOrdering()booleanhasOrdering()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.)booleanhasOrphanDelete()Does this collection implement "orphan delete"?booleanhasWhere()Does this collection role have a where clause filter?protected ObjectincrementIndexByBase(Object index)booleanindexExists(Object key, Object index, SharedSessionContractImplementor session)voidinitCollectionPropertyMap()voidinitialize(Object key, SharedSessionContractImplementor session)Initialize the given collection with the given keyvoidinjectAttributeMapping(PluralAttributeMapping attributeMapping)voidinsertRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)Insert the persistent state of any new collection elementsbooleanisAffectedByEnabledFetchProfiles(LoadQueryInfluencers influencers)booleanisAffectedByEnabledFilters(LoadQueryInfluencers influencers)booleanisAffectedByEnabledFilters(SharedSessionContractImplementor session)booleanisAffectedByEntityGraph(LoadQueryInfluencers influencers)booleanisArray()Is the collection an array?booleanisCollection()Is this instance actually a CollectionPersister?protected booleanisDeleteAllCallable()protected booleanisDeleteCallable()booleanisExtraLazy()protected booleanisInsertCallable()booleanisInverse()Is this collection "inverse", so state changes are not propagated to the database.booleanisLazy()Is the collection lazily initialized?abstract booleanisManyToMany()Is this a many-to-many association? Note that this is mainly a convenience feature as the single persister does not contain all the information needed to handle a many-to-many itself, as internally it is looked at as two many-to-ones.booleanisMutable()Can the elements of this collection change?booleanisPrimitiveArray()Is the collection a primitive array?protected booleanisRowDeleteEnabled()protected booleanisRowInsertEnabled()booleanisSubselectLoadable()protected booleanisUpdateCallable()booleanisVersioned()Does this collection cause version increment of the owning entity?protected voidlogStaticSQL()booleanneedsRemove()WhetherCollectionPersister.remove(Object, SharedSessionContractImplementor)might actually do something, or if it is definitely a no-op.voidpostInstantiate()voidprocessQueuedOps(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)Process queued operations within the PersistentCollection.voidrecreate(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)(Re)create the collection's persistent statevoidremove(Object id, SharedSessionContractImplementor session)Completely remove the persistent state of the collectionStringselectFragment(String alias, String columnSuffix)Generate a list of collection index, key and element columnsString[]toColumns(String propertyName)Given a property path, return the corresponding column name(s).StringtoString()TypetoType(String propertyName)Given a component path expression, get the type of the propertyvoidupdateRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)Update the persistent state of any elements that were modifiedprotected intwriteElement(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session)Write the element to a JDBCPreparedStatementprotected intwriteElementToWhere(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session)Write the element to a JDBCPreparedStatementintwriteIdentifier(PreparedStatement st, Object id, int i, SharedSessionContractImplementor session)Write the identifier to a JDBCPreparedStatementprotected intwriteIndex(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session)Write the index to a JDBCPreparedStatementprotected intwriteIndexToWhere(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session)Write the index to a JDBCPreparedStatementprotected intwriteKey(PreparedStatement st, Object key, int i, SharedSessionContractImplementor session)Write the key to a JDBCPreparedStatement-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.persister.collection.CollectionPersister
isCascadeDeleteEnabled, isOneToMany
-
Methods inherited from interface org.hibernate.persister.entity.Joinable
consumesCollectionAlias, consumesEntityAlias
-
-
-
-
Field Detail
-
hasWhere
protected final boolean hasWhere
-
sqlWhereString
protected final String sqlWhereString
-
indexContainsFormula
protected final boolean indexContainsFormula
-
elementIsPureFormula
protected final boolean elementIsPureFormula
-
elementType
protected final Type elementType
-
keyColumnNames
protected final String[] keyColumnNames
-
indexColumnNames
protected final String[] indexColumnNames
-
indexFormulaTemplates
protected final String[] indexFormulaTemplates
-
indexFormulas
protected final String[] indexFormulas
-
indexColumnIsGettable
protected final boolean[] indexColumnIsGettable
-
indexColumnIsSettable
protected final boolean[] indexColumnIsSettable
-
elementColumnNames
protected final String[] elementColumnNames
-
elementColumnWriters
protected final String[] elementColumnWriters
-
elementColumnReaders
protected final String[] elementColumnReaders
-
elementColumnReaderTemplates
protected final String[] elementColumnReaderTemplates
-
elementFormulaTemplates
protected final String[] elementFormulaTemplates
-
elementFormulas
protected final String[] elementFormulas
-
elementColumnIsGettable
protected final boolean[] elementColumnIsGettable
-
elementColumnIsSettable
protected final boolean[] elementColumnIsSettable
-
elementColumnIsInPrimaryKey
protected final boolean[] elementColumnIsInPrimaryKey
-
indexColumnAliases
protected final String[] indexColumnAliases
-
elementColumnAliases
protected final String[] elementColumnAliases
-
keyColumnAliases
protected final String[] keyColumnAliases
-
identifierColumnName
protected final String identifierColumnName
-
qualifiedTableName
protected final String qualifiedTableName
-
hasIndex
protected final boolean hasIndex
-
hasIdentifier
protected final boolean hasIdentifier
-
isInverse
protected final boolean isInverse
-
batchSize
protected final int batchSize
-
sqlExceptionHelper
protected final SqlExceptionHelper sqlExceptionHelper
-
recreateBatchKey
protected BasicBatchKey recreateBatchKey
-
-
Constructor Detail
-
AbstractCollectionPersister
@Deprecated(since="6.0") public AbstractCollectionPersister(Collection collectionBootDescriptor, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext) throws MappingException, CacheException
Deprecated.- Throws:
MappingExceptionCacheException
-
AbstractCollectionPersister
public AbstractCollectionPersister(Collection collectionBootDescriptor, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext) throws MappingException, CacheException
- Throws:
MappingExceptionCacheException
-
-
Method Detail
-
getSortingComparator
public Comparator<?> getSortingComparator()
Description copied from interface:CollectionPersisterFor sorted collections, the comparator to use. Non-parameterized because for SORTED_SET the elements are compared but for SORTED_MAP the keys are compared- Specified by:
getSortingComparatorin interfaceCollectionPersister- See Also:
CollectionClassification.SORTED_MAP,CollectionClassification.SORTED_SET
-
postInstantiate
public void postInstantiate() throws MappingException- Specified by:
postInstantiatein interfaceCollectionPersister- Throws:
MappingException
-
logStaticSQL
protected void logStaticSQL()
-
initialize
public void initialize(Object key, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersisterInitialize the given collection with the given key- Specified by:
initializein interfaceCollectionPersister- Throws:
HibernateException
-
getStandardCollectionLoader
protected CollectionLoader getStandardCollectionLoader()
-
determineLoaderToUse
protected CollectionLoader determineLoaderToUse(Object key, SharedSessionContractImplementor session)
-
createSubSelectLoader
protected CollectionLoader createSubSelectLoader(SubselectFetch subselect, SharedSessionContractImplementor session)
-
createCollectionLoader
protected CollectionLoader createCollectionLoader(LoadQueryInfluencers loadQueryInfluencers)
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRolein interfaceCollectionPersister
-
getCacheAccessStrategy
public CollectionDataAccess getCacheAccessStrategy()
Description copied from interface:CollectionPersisterGet the cache- Specified by:
getCacheAccessStrategyin interfaceCollectionPersister
-
hasCache
public boolean hasCache()
Description copied from interface:CollectionPersisterIs this collection role cacheable- Specified by:
hasCachein interfaceCollectionPersister
-
getCollectionType
public CollectionType getCollectionType()
Description copied from interface:CollectionPersisterGet the associatedType- Specified by:
getCollectionTypein interfaceCollectionPersister
-
getSQLOrderByString
public String getSQLOrderByString(String alias)
Description copied from interface:QueryableCollectionGet the order by SQL- Specified by:
getSQLOrderByStringin interfaceQueryableCollection
-
getManyToManyOrderByString
public String getManyToManyOrderByString(String alias)
Description copied from interface:QueryableCollectionGet the order-by to be applied at the target table of a many to many- Specified by:
getManyToManyOrderByStringin interfaceQueryableCollection- Parameters:
alias- The alias for the many-to-many target table- Returns:
- appropriate order-by fragment or empty string.
-
getFetchMode
public FetchMode getFetchMode()
Description copied from interface:QueryableCollectionShould we load this collection role by outerjoining?- Specified by:
getFetchModein interfaceQueryableCollection
-
hasOrdering
public boolean hasOrdering()
Description copied from interface:CollectionPersisterIs 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:
hasOrderingin interfaceCollectionPersister
-
hasManyToManyOrdering
public boolean hasManyToManyOrdering()
- Specified by:
hasManyToManyOrderingin interfaceCollectionPersister
-
hasWhere
public boolean hasWhere()
Description copied from interface:QueryableCollectionDoes this collection role have a where clause filter?- Specified by:
hasWherein interfaceQueryableCollection
-
getSQLDeleteString
protected String getSQLDeleteString()
-
getSQLInsertRowString
protected String getSQLInsertRowString()
-
getSQLUpdateRowString
protected String getSQLUpdateRowString()
-
getSQLDeleteRowString
protected String getSQLDeleteRowString()
-
getKeyType
public Type getKeyType()
Description copied from interface:CollectionMetadataThe collection key type- Specified by:
getKeyTypein interfaceCollectionMetadata- Specified by:
getKeyTypein interfaceCollectionPersister
-
getIndexType
public Type getIndexType()
Description copied from interface:CollectionMetadataThe collection index type (or null if the collection has no index)- Specified by:
getIndexTypein interfaceCollectionMetadata- Specified by:
getIndexTypein interfaceCollectionPersister
-
getElementType
public Type getElementType()
Description copied from interface:CollectionMetadataThe collection element type- Specified by:
getElementTypein interfaceCollectionMetadata- Specified by:
getElementTypein interfaceCollectionPersister
-
getElementConverter
public BasicValueConverter<?,?> getElementConverter()
Description copied from interface:CollectionPersisterThe value converter for the element values of this collection- Specified by:
getElementConverterin interfaceCollectionPersister
-
getIndexConverter
public BasicValueConverter<?,?> getIndexConverter()
Description copied from interface:CollectionPersisterThe value converter for index values of this collection (effectively map keys only)- Specified by:
getIndexConverterin interfaceCollectionPersister
-
getElementClass
public Class<?> getElementClass()
Return the element class of an array, or null otherwise. needed by arrays- Specified by:
getElementClassin interfaceCollectionPersister
-
writeKey
protected int writeKey(PreparedStatement st, Object key, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the key to a JDBCPreparedStatement- Throws:
HibernateExceptionSQLException
-
writeElement
protected int writeElement(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the element to a JDBCPreparedStatement- Throws:
HibernateExceptionSQLException
-
writeIndex
protected int writeIndex(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the index to a JDBCPreparedStatement- Throws:
HibernateExceptionSQLException
-
writeElementToWhere
protected int writeElementToWhere(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the element to a JDBCPreparedStatement- Throws:
HibernateExceptionSQLException
-
writeIndexToWhere
protected int writeIndexToWhere(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the index to a JDBCPreparedStatement- Throws:
HibernateExceptionSQLException
-
writeIdentifier
public int writeIdentifier(PreparedStatement st, Object id, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the identifier to a JDBCPreparedStatement- Throws:
HibernateExceptionSQLException
-
isPrimitiveArray
public boolean isPrimitiveArray()
Description copied from interface:CollectionMetadataIs the collection a primitive array?- Specified by:
isPrimitiveArrayin interfaceCollectionMetadata- Specified by:
isPrimitiveArrayin interfaceCollectionPersister
-
isArray
public boolean isArray()
Description copied from interface:CollectionMetadataIs the collection an array?- Specified by:
isArrayin interfaceCollectionMetadata- Specified by:
isArrayin interfaceCollectionPersister
-
getKeyColumnAliases
public String[] getKeyColumnAliases(String suffix)
Description copied from interface:CollectionPersisterGenerates the collection's key column aliases, based on the given suffix.- Specified by:
getKeyColumnAliasesin interfaceCollectionPersister- Parameters:
suffix- The suffix to use in the key column alias generation.- Returns:
- The key column aliases.
-
getElementColumnAliases
public String[] getElementColumnAliases(String suffix)
Description copied from interface:CollectionPersisterGenerates the collection's element column aliases, based on the given suffix.- Specified by:
getElementColumnAliasesin interfaceCollectionPersister- Parameters:
suffix- The suffix to use in the element column alias generation.- Returns:
- The key column aliases.
-
getIndexColumnAliases
public String[] getIndexColumnAliases(String suffix)
Description copied from interface:CollectionPersisterGenerates the collection's index column aliases, based on the given suffix.- Specified by:
getIndexColumnAliasesin interfaceCollectionPersister- Parameters:
suffix- The suffix to use in the index column alias generation.- Returns:
- The key column aliases, or null if not indexed.
-
getIdentifierColumnAlias
public String getIdentifierColumnAlias(String suffix)
Description copied from interface:CollectionPersisterGenerates the collection's identifier column aliases, based on the given suffix.- Specified by:
getIdentifierColumnAliasin interfaceCollectionPersister- Parameters:
suffix- The suffix to use in the key column alias generation.- Returns:
- The key column aliases.
-
getIdentifierColumnName
public String getIdentifierColumnName()
- Specified by:
getIdentifierColumnNamein interfaceSQLLoadableCollection
-
selectFragment
public String selectFragment(String alias, String columnSuffix)
Generate a list of collection index, key and element columns- Specified by:
selectFragmentin interfaceQueryableCollection
-
generateSelectSizeString
protected String generateSelectSizeString(boolean isIntegerIndexed)
-
generateDetectRowByIndexString
protected String generateDetectRowByIndexString()
-
generateDetectRowByElementString
protected String generateDetectRowByElementString()
-
getIndexColumnNames
public String[] getIndexColumnNames()
Description copied from interface:QueryableCollectionGet the names of the collection index columns if this is an indexed collection (optional operation)- Specified by:
getIndexColumnNamesin interfaceQueryableCollection
-
getIndexFormulas
public String[] getIndexFormulas()
Description copied from interface:QueryableCollectionGet the index formulas if this is an indexed collection (optional operation)- Specified by:
getIndexFormulasin interfaceQueryableCollection
-
getIndexColumnNames
public String[] getIndexColumnNames(String alias)
Description copied from interface:QueryableCollectionGet the names of the collection index columns if this is an indexed collection (optional operation), aliased by the given table alias- Specified by:
getIndexColumnNamesin interfaceQueryableCollection
-
getElementColumnNames
public String[] getElementColumnNames(String alias)
Description copied from interface:QueryableCollectionGet 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:
getElementColumnNamesin interfaceQueryableCollection
-
getElementColumnNames
public String[] getElementColumnNames()
Description copied from interface:QueryableCollectionGet the names of the collection element columns (or the primary key columns in the case of a one-to-many association)- Specified by:
getElementColumnNamesin interfaceQueryableCollection
-
getKeyColumnNames
public String[] getKeyColumnNames()
Description copied from interface:JoinableThe columns to join on- Specified by:
getKeyColumnNamesin interfaceJoinable
-
hasIndex
public boolean hasIndex()
Description copied from interface:CollectionMetadataIs this collection indexed?- Specified by:
hasIndexin interfaceCollectionMetadata- Specified by:
hasIndexin interfaceCollectionPersister
-
isLazy
public boolean isLazy()
Description copied from interface:CollectionMetadataIs the collection lazily initialized?- Specified by:
isLazyin interfaceCollectionMetadata- Specified by:
isLazyin interfaceCollectionPersister
-
isInverse
public boolean isInverse()
Description copied from interface:CollectionPersisterIs this collection "inverse", so state changes are not propagated to the database.- Specified by:
isInversein interfaceCollectionPersister
-
getTableName
public String getTableName()
Description copied from interface:JoinableThe table to join to.- Specified by:
getTableNamein interfaceJoinable
-
remove
public void remove(Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersisterCompletely remove the persistent state of the collection- Specified by:
removein interfaceCollectionPersister- Throws:
HibernateException
-
recreate
public void recreate(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersister(Re)create the collection's persistent state- Specified by:
recreatein interfaceCollectionPersister- Throws:
HibernateException
-
isRowDeleteEnabled
protected boolean isRowDeleteEnabled()
-
needsRemove
public boolean needsRemove()
Description copied from interface:CollectionPersisterWhetherCollectionPersister.remove(Object, SharedSessionContractImplementor)might actually do something, or if it is definitely a no-op.- Specified by:
needsRemovein interfaceCollectionPersister
-
deleteRows
public void deleteRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersisterDelete the persistent state of any elements that were removed from the collection- Specified by:
deleteRowsin interfaceCollectionPersister- Throws:
HibernateException
-
isRowInsertEnabled
protected boolean isRowInsertEnabled()
-
insertRows
public void insertRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersisterInsert the persistent state of any new collection elements- Specified by:
insertRowsin interfaceCollectionPersister- Throws:
HibernateException
-
getRole
public String getRole()
Description copied from interface:CollectionMetadataThe name of this collection role- Specified by:
getRolein interfaceCollectionMetadata- Specified by:
getRolein interfaceCollectionPersister
-
getOwnerEntityName
public String getOwnerEntityName()
-
getOwnerEntityPersister
public EntityPersister getOwnerEntityPersister()
Description copied from interface:CollectionPersisterGet the persister of the entity that "owns" this collection- Specified by:
getOwnerEntityPersisterin interfaceCollectionPersister
-
getIdentifierGenerator
public IdentifierGenerator getIdentifierGenerator()
Description copied from interface:CollectionPersisterGet the surrogate key generation strategy (optional operation)- Specified by:
getIdentifierGeneratorin interfaceCollectionPersister
-
getIdentifierType
public Type getIdentifierType()
Description copied from interface:CollectionPersisterGet the type of the surrogate key- Specified by:
getIdentifierTypein interfaceCollectionPersister
-
hasOrphanDelete
public boolean hasOrphanDelete()
Description copied from interface:CollectionPersisterDoes this collection implement "orphan delete"?- Specified by:
hasOrphanDeletein interfaceCollectionPersister
-
toType
public Type toType(String propertyName) throws QueryException
Description copied from interface:PropertyMappingGiven a component path expression, get the type of the property- Specified by:
toTypein interfacePropertyMapping- Throws:
QueryException
-
applyBaseRestrictions
public void applyBaseRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)
Description copied from interface:RestrictableApplies the base set of restrictions. The impact varies based on Restrictable type - some apply restrictions for filter, where and/or discriminator- Specified by:
applyBaseRestrictionsin interfaceRestrictable
-
applyWhereRestrictions
public void applyWhereRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, SqlAstCreationState creationState)
Description copied from interface:WhereRestrictableApply theWhererestrictions- Specified by:
applyWhereRestrictionsin interfaceWhereRestrictable
-
applyWhereFragments
protected void applyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState astCreationState)
-
applyFilterRestrictions
public void applyFilterRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, SqlAstCreationState creationState)
Description copied from interface:FilterRestrictableApplies just theFiltervalues enabled for the associated entity- Specified by:
applyFilterRestrictionsin interfaceFilterRestrictable
-
isManyToMany
public abstract boolean isManyToMany()
Description copied from interface:CollectionPersisterIs this a many-to-many association? Note that this is mainly a convenience feature as the single persister does not contain all the information needed to handle a many-to-many itself, as internally it is looked at as two many-to-ones.- Specified by:
isManyToManyin interfaceCollectionPersister
-
applyBaseManyToManyRestrictions
public void applyBaseManyToManyRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)
- Specified by:
applyBaseManyToManyRestrictionsin interfaceCollectionPersister
-
getManyToManyFilterFragment
public String getManyToManyFilterFragment(TableGroup tableGroup, Map<String,Filter> enabledFilters)
- Specified by:
getManyToManyFilterFragmentin interfaceCollectionPersister
-
toColumns
public String[] toColumns(String propertyName) throws QueryException
Description copied from interface:PropertyMappingGiven a property path, return the corresponding column name(s).- Specified by:
toColumnsin interfacePropertyMapping- Throws:
QueryException
-
getName
public String getName()
Description copied from interface:JoinableAn identifying name; a class name or collection role name.
-
getElementPersister
public EntityPersister getElementPersister()
Description copied from interface:QueryableCollectionGet 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 beOuterJoinLoadable.- Specified by:
getElementPersisterin interfaceQueryableCollection
-
getElementPersisterInternal
protected EntityPersister getElementPersisterInternal()
-
isCollection
public boolean isCollection()
Description copied from interface:JoinableIs this instance actually a CollectionPersister?- Specified by:
isCollectionin interfaceJoinable
-
getCollectionSpaces
public Serializable[] getCollectionSpaces()
Description copied from interface:CollectionPersisterGet the "space" that holds the persistent state- Specified by:
getCollectionSpacesin interfaceCollectionPersister
-
generateDeleteString
protected abstract String generateDeleteString()
-
generateDeleteRowString
protected abstract String generateDeleteRowString()
-
generateUpdateRowString
protected abstract String generateUpdateRowString()
-
generateInsertRowString
protected abstract String generateInsertRowString()
-
updateRows
public void updateRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersisterUpdate the persistent state of any elements that were modified- Specified by:
updateRowsin interfaceCollectionPersister- Throws:
HibernateException
-
doUpdateRows
protected abstract int doUpdateRows(Object key, PersistentCollection<?> collection, SharedSessionContractImplementor session)
-
processQueuedOps
public void processQueuedOps(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)
Description copied from interface:CollectionPersisterProcess queued operations within the PersistentCollection.- Specified by:
processQueuedOpsin interfaceCollectionPersister
-
doProcessQueuedOps
protected abstract void doProcessQueuedOps(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session) throws HibernateException
- Throws:
HibernateException
-
getCollectionMetadata
@Deprecated public CollectionMetadata getCollectionMetadata()
Deprecated.Description copied from interface:CollectionPersisterGet the user-visible metadata for the collection (optional operation)- Specified by:
getCollectionMetadatain interfaceCollectionPersister
-
getFactory
public SessionFactoryImplementor getFactory()
- Specified by:
getFactoryin interfaceCollectionPersister
-
isInsertCallable
protected boolean isInsertCallable()
-
getInsertCheckStyle
protected ExecuteUpdateResultCheckStyle getInsertCheckStyle()
-
isUpdateCallable
protected boolean isUpdateCallable()
-
getUpdateCheckStyle
protected ExecuteUpdateResultCheckStyle getUpdateCheckStyle()
-
isDeleteCallable
protected boolean isDeleteCallable()
-
getDeleteCheckStyle
protected ExecuteUpdateResultCheckStyle getDeleteCheckStyle()
-
isDeleteAllCallable
protected boolean isDeleteAllCallable()
-
getDeleteAllCheckStyle
protected ExecuteUpdateResultCheckStyle getDeleteAllCheckStyle()
-
isVersioned
public boolean isVersioned()
Description copied from interface:CollectionPersisterDoes this collection cause version increment of the owning entity?- Specified by:
isVersionedin interfaceCollectionPersister
-
getSQLExceptionConverter
protected SQLExceptionConverter getSQLExceptionConverter()
-
getSQLExceptionHelper
protected SqlExceptionHelper getSQLExceptionHelper()
-
getCacheEntryStructure
public CacheEntryStructure getCacheEntryStructure()
Description copied from interface:CollectionPersisterGet the cache structure- Specified by:
getCacheEntryStructurein interfaceCollectionPersister
-
isAffectedByEnabledFilters
public boolean isAffectedByEnabledFilters(SharedSessionContractImplementor session)
- Specified by:
isAffectedByEnabledFiltersin interfaceCollectionPersister
-
isSubselectLoadable
public boolean isSubselectLoadable()
-
isMutable
public boolean isMutable()
Description copied from interface:CollectionPersisterCan the elements of this collection change?- Specified by:
isMutablein interfaceCollectionPersister
-
getCollectionPropertyColumnAliases
public String[] getCollectionPropertyColumnAliases(String propertyName, String suffix)
- Specified by:
getCollectionPropertyColumnAliasesin interfaceSQLLoadableCollection
-
initCollectionPropertyMap
public void initCollectionPropertyMap()
-
getSize
public int getSize(Object key, SharedSessionContractImplementor session)
- Specified by:
getSizein interfaceCollectionPersister
-
indexExists
public boolean indexExists(Object key, Object index, SharedSessionContractImplementor session)
- Specified by:
indexExistsin interfaceCollectionPersister
-
elementExists
public boolean elementExists(Object key, Object element, SharedSessionContractImplementor session)
- Specified by:
elementExistsin interfaceCollectionPersister
-
getElementByIndex
public Object getElementByIndex(Object key, Object index, SharedSessionContractImplementor session, Object owner)
- Specified by:
getElementByIndexin interfaceCollectionPersister
-
isExtraLazy
public boolean isExtraLazy()
- Specified by:
isExtraLazyin interfaceCollectionPersister
-
getDialect
protected Dialect getDialect()
-
getBatchSize
public int getBatchSize()
- Specified by:
getBatchSizein interfaceCollectionPersister
-
getMappedByProperty
public String getMappedByProperty()
- Specified by:
getMappedByPropertyin interfaceCollectionPersister- Returns:
- the name of the property this collection is mapped by
-
getFilterAliasGenerator
public abstract FilterAliasGenerator getFilterAliasGenerator(String rootAlias)
-
getFilterAliasGenerator
public abstract FilterAliasGenerator getFilterAliasGenerator(TableGroup tableGroup)
-
injectAttributeMapping
public void injectAttributeMapping(PluralAttributeMapping attributeMapping)
- Specified by:
injectAttributeMappingin interfacePluralAttributeMappingImpl.Aware
-
getAttributeMapping
public PluralAttributeMapping getAttributeMapping()
- Specified by:
getAttributeMappingin interfaceCollectionPersister
-
isAffectedByEnabledFilters
public boolean isAffectedByEnabledFilters(LoadQueryInfluencers influencers)
- Specified by:
isAffectedByEnabledFiltersin interfaceCollectionPersister
-
isAffectedByEntityGraph
public boolean isAffectedByEntityGraph(LoadQueryInfluencers influencers)
- Specified by:
isAffectedByEntityGraphin interfaceCollectionPersister
-
isAffectedByEnabledFetchProfiles
public boolean isAffectedByEnabledFetchProfiles(LoadQueryInfluencers influencers)
- Specified by:
isAffectedByEnabledFetchProfilesin interfaceCollectionPersister
-
getCollectionSemantics
public CollectionSemantics<?,?> getCollectionSemantics()
- Specified by:
getCollectionSemanticsin interfaceCollectionPersister
-
createInsert
protected Insert createInsert()
-
createUpdate
protected Update createUpdate()
-
createDelete
protected Delete createDelete()
-
-