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 theQueryableCollection
interface.- 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 void
applyBaseManyToManyRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)
void
applyBaseRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)
Applies the base set of restrictions.void
applyFilterRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, SqlAstCreationState creationState)
Applies just theFilter
values enabled for the associated entityprotected void
applyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState astCreationState)
void
applyWhereRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, SqlAstCreationState creationState)
Apply theWhere
restrictionsprotected CollectionLoader
createCollectionLoader(LoadQueryInfluencers loadQueryInfluencers)
protected Delete
createDelete()
protected Insert
createInsert()
protected CollectionLoader
createSubSelectLoader(SubselectFetch subselect, SharedSessionContractImplementor session)
protected Update
createUpdate()
protected Object
decrementIndexByBase(Object index)
void
deleteRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)
Delete the persistent state of any elements that were removed from the collectionprotected CollectionLoader
determineLoaderToUse(Object key, SharedSessionContractImplementor session)
protected String
determineTableName(Table table)
protected abstract void
doProcessQueuedOps(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)
protected abstract int
doUpdateRows(Object key, PersistentCollection<?> collection, SharedSessionContractImplementor session)
boolean
elementExists(Object key, Object element, SharedSessionContractImplementor session)
protected abstract String
generateDeleteRowString()
protected abstract String
generateDeleteString()
protected String
generateDetectRowByElementString()
protected String
generateDetectRowByIndexString()
protected abstract String
generateInsertRowString()
protected String
generateSelectSizeString(boolean isIntegerIndexed)
protected abstract String
generateUpdateRowString()
PluralAttributeMapping
getAttributeMapping()
int
getBatchSize()
CollectionDataAccess
getCacheAccessStrategy()
Get the cacheCacheEntryStructure
getCacheEntryStructure()
Get the cache structureCollectionMetadata
getCollectionMetadata()
Deprecated.String[]
getCollectionPropertyColumnAliases(String propertyName, String suffix)
CollectionSemantics<?,?>
getCollectionSemantics()
Serializable[]
getCollectionSpaces()
Get the "space" that holds the persistent stateCollectionType
getCollectionType()
Get the associatedType
protected ExecuteUpdateResultCheckStyle
getDeleteAllCheckStyle()
protected ExecuteUpdateResultCheckStyle
getDeleteCheckStyle()
protected Dialect
getDialect()
Object
getElementByIndex(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 collectionEntityPersister
getElementPersister()
Get the persister of the element class, if this is a collection of entities (optional operation).protected EntityPersister
getElementPersisterInternal()
Type
getElementType()
The collection element typeSessionFactoryImplementor
getFactory()
FetchMode
getFetchMode()
Should we load this collection role by outerjoining?abstract FilterAliasGenerator
getFilterAliasGenerator(String rootAlias)
abstract FilterAliasGenerator
getFilterAliasGenerator(TableGroup tableGroup)
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 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)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 onType
getKeyType()
The collection key typeString
getManyToManyFilterFragment(TableGroup tableGroup, Map<String,Filter> enabledFilters)
String
getManyToManyOrderByString(String alias)
Get the order-by to be applied at the target table of a many to manyString
getMappedByProperty()
String
getName()
An identifying name; a class name or collection role name.NavigableRole
getNavigableRole()
String
getOwnerEntityName()
EntityPersister
getOwnerEntityPersister()
Get the persister of the entity that "owns" this collectionString
getRole()
The name of this collection roleint
getSize(Object key, SharedSessionContractImplementor session)
Comparator<?>
getSortingComparator()
For sorted collections, the comparator to use.protected String
getSQLDeleteRowString()
protected String
getSQLDeleteString()
protected SQLExceptionConverter
getSQLExceptionConverter()
protected SqlExceptionHelper
getSQLExceptionHelper()
protected String
getSQLInsertRowString()
String
getSQLOrderByString(String alias)
Get the order by SQLprotected String
getSQLUpdateRowString()
protected CollectionLoader
getStandardCollectionLoader()
String
getTableName()
The table to join to.protected ExecuteUpdateResultCheckStyle
getUpdateCheckStyle()
boolean
hasCache()
Is this collection role cacheableboolean
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(Object key, Object index, SharedSessionContractImplementor session)
void
initCollectionPropertyMap()
void
initialize(Object key, SharedSessionContractImplementor session)
Initialize the given collection with the given keyvoid
injectAttributeMapping(PluralAttributeMapping attributeMapping)
void
insertRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)
Insert the persistent state of any new collection elementsboolean
isAffectedByEnabledFetchProfiles(LoadQueryInfluencers influencers)
boolean
isAffectedByEnabledFilters(LoadQueryInfluencers influencers)
boolean
isAffectedByEnabledFilters(SharedSessionContractImplementor session)
boolean
isAffectedByEntityGraph(LoadQueryInfluencers influencers)
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 propagated 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 contain 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()
boolean
needsRemove()
WhetherCollectionPersister.remove(Object, SharedSessionContractImplementor)
might actually do something, or if it is definitely a no-op.void
postInstantiate()
void
processQueuedOps(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)
Process queued operations within the PersistentCollection.void
recreate(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)
(Re)create the collection's persistent statevoid
remove(Object id, SharedSessionContractImplementor session)
Completely remove the persistent state of the collectionString
selectFragment(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).String
toString()
Type
toType(String propertyName)
Given a component path expression, get the type of the propertyvoid
updateRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)
Update the persistent state of any elements that were modifiedprotected int
writeElement(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session)
Write the element to a JDBCPreparedStatement
protected int
writeElementToWhere(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session)
Write the element to a JDBCPreparedStatement
int
writeIdentifier(PreparedStatement st, Object id, int i, SharedSessionContractImplementor session)
Write the identifier to a JDBCPreparedStatement
protected int
writeIndex(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session)
Write the index to a JDBCPreparedStatement
protected int
writeIndexToWhere(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session)
Write the index to a JDBCPreparedStatement
protected int
writeKey(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:
MappingException
CacheException
-
AbstractCollectionPersister
public AbstractCollectionPersister(Collection collectionBootDescriptor, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext) throws MappingException, CacheException
- Throws:
MappingException
CacheException
-
-
Method Detail
-
getSortingComparator
public Comparator<?> getSortingComparator()
Description copied from interface:CollectionPersister
For 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:
getSortingComparator
in interfaceCollectionPersister
- See Also:
CollectionClassification.SORTED_MAP
,CollectionClassification.SORTED_SET
-
postInstantiate
public void postInstantiate() throws MappingException
- Specified by:
postInstantiate
in interfaceCollectionPersister
- Throws:
MappingException
-
logStaticSQL
protected void logStaticSQL()
-
initialize
public void initialize(Object key, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersister
Initialize the given collection with the given key- Specified by:
initialize
in 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:
getNavigableRole
in interfaceCollectionPersister
-
getCacheAccessStrategy
public CollectionDataAccess getCacheAccessStrategy()
Description copied from interface:CollectionPersister
Get the cache- Specified by:
getCacheAccessStrategy
in interfaceCollectionPersister
-
hasCache
public boolean hasCache()
Description copied from interface:CollectionPersister
Is this collection role cacheable- Specified by:
hasCache
in interfaceCollectionPersister
-
getCollectionType
public CollectionType getCollectionType()
Description copied from interface:CollectionPersister
Get the associatedType
- Specified by:
getCollectionType
in interfaceCollectionPersister
-
getSQLOrderByString
public String getSQLOrderByString(String alias)
Description copied from interface:QueryableCollection
Get the order by SQL- Specified by:
getSQLOrderByString
in interfaceQueryableCollection
-
getManyToManyOrderByString
public String getManyToManyOrderByString(String alias)
Description copied from interface:QueryableCollection
Get the order-by to be applied at the target table of a many to many- Specified by:
getManyToManyOrderByString
in 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:QueryableCollection
Should we load this collection role by outerjoining?- Specified by:
getFetchMode
in interfaceQueryableCollection
-
hasOrdering
public boolean hasOrdering()
Description copied from interface:CollectionPersister
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 interfaceCollectionPersister
-
hasManyToManyOrdering
public boolean hasManyToManyOrdering()
- Specified by:
hasManyToManyOrdering
in interfaceCollectionPersister
-
hasWhere
public boolean hasWhere()
Description copied from interface:QueryableCollection
Does this collection role have a where clause filter?- Specified by:
hasWhere
in 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:CollectionMetadata
The collection key type- Specified by:
getKeyType
in interfaceCollectionMetadata
- Specified by:
getKeyType
in interfaceCollectionPersister
-
getIndexType
public Type getIndexType()
Description copied from interface:CollectionMetadata
The collection index type (or null if the collection has no index)- Specified by:
getIndexType
in interfaceCollectionMetadata
- Specified by:
getIndexType
in interfaceCollectionPersister
-
getElementType
public Type getElementType()
Description copied from interface:CollectionMetadata
The collection element type- Specified by:
getElementType
in interfaceCollectionMetadata
- Specified by:
getElementType
in interfaceCollectionPersister
-
getElementConverter
public BasicValueConverter<?,?> getElementConverter()
Description copied from interface:CollectionPersister
The value converter for the element values of this collection- Specified by:
getElementConverter
in interfaceCollectionPersister
-
getIndexConverter
public BasicValueConverter<?,?> getIndexConverter()
Description copied from interface:CollectionPersister
The value converter for index values of this collection (effectively map keys only)- Specified by:
getIndexConverter
in interfaceCollectionPersister
-
getElementClass
public Class<?> getElementClass()
Return the element class of an array, or null otherwise. needed by arrays- Specified by:
getElementClass
in interfaceCollectionPersister
-
writeKey
protected int writeKey(PreparedStatement st, Object key, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the key to a JDBCPreparedStatement
- Throws:
HibernateException
SQLException
-
writeElement
protected int writeElement(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the element to a JDBCPreparedStatement
- Throws:
HibernateException
SQLException
-
writeIndex
protected int writeIndex(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the index to a JDBCPreparedStatement
- Throws:
HibernateException
SQLException
-
writeElementToWhere
protected int writeElementToWhere(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the element to a JDBCPreparedStatement
- Throws:
HibernateException
SQLException
-
writeIndexToWhere
protected int writeIndexToWhere(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the index to a JDBCPreparedStatement
- Throws:
HibernateException
SQLException
-
writeIdentifier
public int writeIdentifier(PreparedStatement st, Object id, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException
Write the identifier to a JDBCPreparedStatement
- Throws:
HibernateException
SQLException
-
isPrimitiveArray
public boolean isPrimitiveArray()
Description copied from interface:CollectionMetadata
Is the collection a primitive array?- Specified by:
isPrimitiveArray
in interfaceCollectionMetadata
- Specified by:
isPrimitiveArray
in interfaceCollectionPersister
-
isArray
public boolean isArray()
Description copied from interface:CollectionMetadata
Is the collection an array?- Specified by:
isArray
in interfaceCollectionMetadata
- Specified by:
isArray
in interfaceCollectionPersister
-
getKeyColumnAliases
public String[] getKeyColumnAliases(String suffix)
Description copied from interface:CollectionPersister
Generates the collection's key column aliases, based on the given suffix.- Specified by:
getKeyColumnAliases
in 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:CollectionPersister
Generates the collection's element column aliases, based on the given suffix.- Specified by:
getElementColumnAliases
in 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:CollectionPersister
Generates the collection's index column aliases, based on the given suffix.- Specified by:
getIndexColumnAliases
in 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:CollectionPersister
Generates the collection's identifier column aliases, based on the given suffix.- Specified by:
getIdentifierColumnAlias
in interfaceCollectionPersister
- 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 interfaceSQLLoadableCollection
-
selectFragment
public String selectFragment(String alias, String columnSuffix)
Generate a list of collection index, key and element columns- Specified by:
selectFragment
in interfaceQueryableCollection
-
generateSelectSizeString
protected String generateSelectSizeString(boolean isIntegerIndexed)
-
generateDetectRowByIndexString
protected String generateDetectRowByIndexString()
-
generateDetectRowByElementString
protected String generateDetectRowByElementString()
-
getIndexColumnNames
public String[] getIndexColumnNames()
Description copied from interface:QueryableCollection
Get the names of the collection index columns if this is an indexed collection (optional operation)- Specified by:
getIndexColumnNames
in interfaceQueryableCollection
-
getIndexFormulas
public String[] getIndexFormulas()
Description copied from interface:QueryableCollection
Get the index formulas if this is an indexed collection (optional operation)- Specified by:
getIndexFormulas
in interfaceQueryableCollection
-
getIndexColumnNames
public String[] getIndexColumnNames(String alias)
Description copied from interface:QueryableCollection
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 interfaceQueryableCollection
-
getElementColumnNames
public String[] getElementColumnNames(String alias)
Description copied from interface:QueryableCollection
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 interfaceQueryableCollection
-
getElementColumnNames
public String[] getElementColumnNames()
Description copied from interface:QueryableCollection
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 interfaceQueryableCollection
-
getKeyColumnNames
public String[] getKeyColumnNames()
Description copied from interface:Joinable
The columns to join on- Specified by:
getKeyColumnNames
in interfaceJoinable
-
hasIndex
public boolean hasIndex()
Description copied from interface:CollectionMetadata
Is this collection indexed?- Specified by:
hasIndex
in interfaceCollectionMetadata
- Specified by:
hasIndex
in interfaceCollectionPersister
-
isLazy
public boolean isLazy()
Description copied from interface:CollectionMetadata
Is the collection lazily initialized?- Specified by:
isLazy
in interfaceCollectionMetadata
- Specified by:
isLazy
in interfaceCollectionPersister
-
isInverse
public boolean isInverse()
Description copied from interface:CollectionPersister
Is this collection "inverse", so state changes are not propagated to the database.- Specified by:
isInverse
in interfaceCollectionPersister
-
getTableName
public String getTableName()
Description copied from interface:Joinable
The table to join to.- Specified by:
getTableName
in interfaceJoinable
-
remove
public void remove(Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersister
Completely remove the persistent state of the collection- Specified by:
remove
in 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:
recreate
in interfaceCollectionPersister
- Throws:
HibernateException
-
isRowDeleteEnabled
protected boolean isRowDeleteEnabled()
-
needsRemove
public boolean needsRemove()
Description copied from interface:CollectionPersister
WhetherCollectionPersister.remove(Object, SharedSessionContractImplementor)
might actually do something, or if it is definitely a no-op.- Specified by:
needsRemove
in interfaceCollectionPersister
-
deleteRows
public void deleteRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersister
Delete the persistent state of any elements that were removed from the collection- Specified by:
deleteRows
in interfaceCollectionPersister
- Throws:
HibernateException
-
isRowInsertEnabled
protected boolean isRowInsertEnabled()
-
insertRows
public void insertRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:CollectionPersister
Insert the persistent state of any new collection elements- Specified by:
insertRows
in interfaceCollectionPersister
- Throws:
HibernateException
-
getRole
public String getRole()
Description copied from interface:CollectionMetadata
The name of this collection role- Specified by:
getRole
in interfaceCollectionMetadata
- Specified by:
getRole
in interfaceCollectionPersister
-
getOwnerEntityName
public String getOwnerEntityName()
-
getOwnerEntityPersister
public EntityPersister getOwnerEntityPersister()
Description copied from interface:CollectionPersister
Get the persister of the entity that "owns" this collection- Specified by:
getOwnerEntityPersister
in interfaceCollectionPersister
-
getIdentifierGenerator
public IdentifierGenerator getIdentifierGenerator()
Description copied from interface:CollectionPersister
Get the surrogate key generation strategy (optional operation)- Specified by:
getIdentifierGenerator
in interfaceCollectionPersister
-
getIdentifierType
public Type getIdentifierType()
Description copied from interface:CollectionPersister
Get the type of the surrogate key- Specified by:
getIdentifierType
in interfaceCollectionPersister
-
hasOrphanDelete
public boolean hasOrphanDelete()
Description copied from interface:CollectionPersister
Does this collection implement "orphan delete"?- Specified by:
hasOrphanDelete
in interfaceCollectionPersister
-
toType
public Type toType(String propertyName) throws QueryException
Description copied from interface:PropertyMapping
Given a component path expression, get the type of the property- Specified by:
toType
in 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:Restrictable
Applies the base set of restrictions. The impact varies based on Restrictable type - some apply restrictions for filter, where and/or discriminator- Specified by:
applyBaseRestrictions
in interfaceRestrictable
-
applyWhereRestrictions
public void applyWhereRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, SqlAstCreationState creationState)
Description copied from interface:WhereRestrictable
Apply theWhere
restrictions- Specified by:
applyWhereRestrictions
in 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:FilterRestrictable
Applies just theFilter
values enabled for the associated entity- Specified by:
applyFilterRestrictions
in interfaceFilterRestrictable
-
isManyToMany
public abstract boolean isManyToMany()
Description copied from interface:CollectionPersister
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.- Specified by:
isManyToMany
in interfaceCollectionPersister
-
applyBaseManyToManyRestrictions
public void applyBaseManyToManyRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)
- Specified by:
applyBaseManyToManyRestrictions
in interfaceCollectionPersister
-
getManyToManyFilterFragment
public String getManyToManyFilterFragment(TableGroup tableGroup, Map<String,Filter> enabledFilters)
- Specified by:
getManyToManyFilterFragment
in interfaceCollectionPersister
-
toColumns
public String[] toColumns(String propertyName) throws QueryException
Description copied from interface:PropertyMapping
Given a property path, return the corresponding column name(s).- Specified by:
toColumns
in interfacePropertyMapping
- Throws:
QueryException
-
getName
public String getName()
Description copied from interface:Joinable
An identifying name; a class name or collection role name.
-
getElementPersister
public EntityPersister getElementPersister()
Description copied from interface:QueryableCollection
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 beOuterJoinLoadable
.- Specified by:
getElementPersister
in interfaceQueryableCollection
-
getElementPersisterInternal
protected EntityPersister getElementPersisterInternal()
-
isCollection
public boolean isCollection()
Description copied from interface:Joinable
Is this instance actually a CollectionPersister?- Specified by:
isCollection
in interfaceJoinable
-
getCollectionSpaces
public Serializable[] getCollectionSpaces()
Description copied from interface:CollectionPersister
Get the "space" that holds the persistent state- Specified by:
getCollectionSpaces
in 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:CollectionPersister
Update the persistent state of any elements that were modified- Specified by:
updateRows
in 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:CollectionPersister
Process queued operations within the PersistentCollection.- Specified by:
processQueuedOps
in 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:CollectionPersister
Get the user-visible metadata for the collection (optional operation)- Specified by:
getCollectionMetadata
in interfaceCollectionPersister
-
getFactory
public SessionFactoryImplementor getFactory()
- Specified by:
getFactory
in 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:CollectionPersister
Does this collection cause version increment of the owning entity?- Specified by:
isVersioned
in interfaceCollectionPersister
-
getSQLExceptionConverter
protected SQLExceptionConverter getSQLExceptionConverter()
-
getSQLExceptionHelper
protected SqlExceptionHelper getSQLExceptionHelper()
-
getCacheEntryStructure
public CacheEntryStructure getCacheEntryStructure()
Description copied from interface:CollectionPersister
Get the cache structure- Specified by:
getCacheEntryStructure
in interfaceCollectionPersister
-
isAffectedByEnabledFilters
public boolean isAffectedByEnabledFilters(SharedSessionContractImplementor session)
- Specified by:
isAffectedByEnabledFilters
in interfaceCollectionPersister
-
isSubselectLoadable
public boolean isSubselectLoadable()
-
isMutable
public boolean isMutable()
Description copied from interface:CollectionPersister
Can the elements of this collection change?- Specified by:
isMutable
in interfaceCollectionPersister
-
getCollectionPropertyColumnAliases
public String[] getCollectionPropertyColumnAliases(String propertyName, String suffix)
- Specified by:
getCollectionPropertyColumnAliases
in interfaceSQLLoadableCollection
-
initCollectionPropertyMap
public void initCollectionPropertyMap()
-
getSize
public int getSize(Object key, SharedSessionContractImplementor session)
- Specified by:
getSize
in interfaceCollectionPersister
-
indexExists
public boolean indexExists(Object key, Object index, SharedSessionContractImplementor session)
- Specified by:
indexExists
in interfaceCollectionPersister
-
elementExists
public boolean elementExists(Object key, Object element, SharedSessionContractImplementor session)
- Specified by:
elementExists
in interfaceCollectionPersister
-
getElementByIndex
public Object getElementByIndex(Object key, Object index, SharedSessionContractImplementor session, Object owner)
- Specified by:
getElementByIndex
in interfaceCollectionPersister
-
isExtraLazy
public boolean isExtraLazy()
- Specified by:
isExtraLazy
in interfaceCollectionPersister
-
getDialect
protected Dialect getDialect()
-
getBatchSize
public int getBatchSize()
- Specified by:
getBatchSize
in interfaceCollectionPersister
-
getMappedByProperty
public String getMappedByProperty()
- Specified by:
getMappedByProperty
in 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:
injectAttributeMapping
in interfacePluralAttributeMappingImpl.Aware
-
getAttributeMapping
public PluralAttributeMapping getAttributeMapping()
- Specified by:
getAttributeMapping
in interfaceCollectionPersister
-
isAffectedByEnabledFilters
public boolean isAffectedByEnabledFilters(LoadQueryInfluencers influencers)
- Specified by:
isAffectedByEnabledFilters
in interfaceCollectionPersister
-
isAffectedByEntityGraph
public boolean isAffectedByEntityGraph(LoadQueryInfluencers influencers)
- Specified by:
isAffectedByEntityGraph
in interfaceCollectionPersister
-
isAffectedByEnabledFetchProfiles
public boolean isAffectedByEnabledFetchProfiles(LoadQueryInfluencers influencers)
- Specified by:
isAffectedByEnabledFetchProfiles
in interfaceCollectionPersister
-
getCollectionSemantics
public CollectionSemantics<?,?> getCollectionSemantics()
- Specified by:
getCollectionSemantics
in interfaceCollectionPersister
-
createInsert
protected Insert createInsert()
-
createUpdate
protected Update createUpdate()
-
createDelete
protected Delete createDelete()
-
-