Class AbstractCollectionPersister
- java.lang.Object
-
- org.hibernate.persister.collection.AbstractCollectionPersister
-
- All Implemented Interfaces:
FetchProfileAffectee,CollectionMetadata,FilterRestrictable,PluralAttributeMappingImpl.Aware,Restrictable,WhereRestrictable,CollectionPersister,DeprecatedCollectionStuff,CollectionMutationTarget,QueryableCollection,SQLLoadableCollection,Joinable,PropertyMapping,MutationTarget<CollectionTableMapping>
- Direct Known Subclasses:
BasicCollectionPersister,OneToManyPersister
@Internal public abstract class AbstractCollectionPersister extends Object implements CollectionPersister, CollectionMutationTarget, PluralAttributeMappingImpl.Aware, FetchProfileAffectee, DeprecatedCollectionStuff
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 JdbcMutationOperationbuildDeleteAllOperation(MutatingTableReference tableReference)protected CollectionLoadercreateCollectionLoader(LoadQueryInfluencers loadQueryInfluencers)protected CollectionLoadercreateSubSelectLoader(SubselectFetch subselect, SharedSessionContractImplementor session)protected @Remove ObjectdecrementIndexByBase(Object index)Deprecated, for removal: This API element is subject to removal in a future version.No longer used.protected CollectionLoaderdetermineLoaderToUse(Object key, SharedSessionContractImplementor session)protected StringdetermineTableName(Table table)protected abstract voiddoProcessQueuedOps(PersistentCollection<?> collection, Object key, SharedSessionContractImplementor session)booleanelementExists(Object key, Object element, SharedSessionContractImplementor session)voidforEachMutableTable(Consumer<CollectionTableMapping> consumer)Visit each table.voidforEachMutableTableReverse(Consumer<CollectionTableMapping> consumer)Same asMutationTarget.forEachMutableTable(java.util.function.Consumer<T>)except that here the tables are visited in reverse orderRestrictedTableMutation<JdbcMutationOperation>generateDeleteAllAst(MutatingTableReference tableReference)protected StringgenerateDetectRowByElementString()protected StringgenerateDetectRowByIndexString()protected StringgenerateSelectSizeString(boolean isIntegerIndexed)PluralAttributeMappinggetAttributeMapping()intgetBatchSize()CollectionDataAccessgetCacheAccessStrategy()Access to the collection's cache regionCacheEntryStructuregetCacheEntryStructure()Get the structure used to store data into the collection's cache regionCollectionMetadatagetCollectionMetadata()Deprecated.String[]getCollectionPropertyColumnAliases(String propertyName, String suffix)CollectionSemantics<?,?>getCollectionSemantics()String[]getCollectionSpaces()Get the "space" that holds the persistent stateCollectionTableMappinggetCollectionTableMapping()CollectionTypegetCollectionType()Get the associatedTypeprotected 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 aliasEntityPersistergetElementPersister()Get the persister of the element class, if this is a collection of entities (optional operation).protected EntityPersistergetElementPersisterInternal()TypegetElementType()Get the "element" typeSessionFactoryImplementorgetFactory()FetchModegetFetchMode()Should we load this collection role by outerjoining?abstract FilterAliasGeneratorgetFilterAliasGenerator(String rootAlias)abstract FilterAliasGeneratorgetFilterAliasGenerator(TableGroup tableGroup)BeforeExecutionGeneratorgetGenerator()Get the surrogate key generation strategy (optional operation)StringgetIdentifierColumnAlias(String suffix)Generates the collection's identifier column aliases, based on the given suffix.StringgetIdentifierColumnName()IdentifierGeneratorgetIdentifierGenerator()Deprecated.StringgetIdentifierTableName()The name of the table defining the identifier for this targetTypegetIdentifierType()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 aliasString[]getIndexFormulas()Get the index formulas if this is an indexed collection (optional operation)TypegetIndexType()Get the "index" type for a list or map (optional operation)String[]getKeyColumnAliases(String suffix)Generates the collection's key column aliases, based on the given suffix.String[]getKeyColumnNames()The columns to join onTypegetKeyType()Get the "key" type (the type of the foreign key)StringgetManyToManyFilterFragment(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()The NavigableRole for this collection.StringgetOwnerEntityName()EntityPersistergetOwnerEntityPersister()Get the persister of the entity that "owns" this collectionprotected abstract RemoveCoordinatorgetRemoveCoordinator()protected abstract RowMutationOperationsgetRowMutationOperations()intgetSize(Object key, SharedSessionContractImplementor session)Comparator<?>getSortingComparator()For sorted collections, the comparator to use.protected SqlExceptionHelpergetSQLExceptionHelper()StringgetSQLOrderByString(String alias)Get the order by SQLprotected CollectionLoadergetStandardCollectionLoader()StringgetTableName()The table to join to.PluralAttributeMappinggetTargetPart()The ModelPart describing the mutation targetbooleanhasCache()Is this collection role cacheablebooleanhasIndex()Is this an "indexed" collection? (list or map)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"?booleanhasPhysicalIndexColumn()Whether the collection has at least one physical index columnbooleanhasWhere()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)Allows injection of the corresponding plural-attribute mapping.booleanisAffectedByEnabledFetchProfiles(LoadQueryInfluencers influencers)booleanisAffectedByEnabledFilters(LoadQueryInfluencers influencers)booleanisAffectedByEnabledFilters(SharedSessionContractImplementor session)booleanisAffectedByEntityGraph(LoadQueryInfluencers influencers)booleanisArray()Is this an array?booleanisCollection()Is this instance actually a CollectionPersister?booleanisExtraLazy()booleanisInverse()Is this collection "inverse", so state changes are not propagated to the database.booleanisLazy()Is this 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 this an array or primitive values?protected booleanisRowDeleteEnabled()protected booleanisRowInsertEnabled()booleanisSubselectLoadable()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.voidregisterAffectingFetchProfile(String fetchProfileName, Fetch.Style fetchStyle)Register the profile name with the entity/collectionvoidremove(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 property-
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.mutation.CollectionMutationTarget
getIdentifierTableMapping
-
Methods inherited from interface org.hibernate.persister.collection.CollectionPersister
deleteRows, insertRows, isCascadeDeleteEnabled, isOneToMany, recreate, updateRows
-
Methods inherited from interface org.hibernate.persister.collection.DeprecatedCollectionStuff
getRole
-
Methods inherited from interface org.hibernate.persister.entity.Joinable
consumesCollectionAlias, consumesEntityAlias
-
Methods inherited from interface org.hibernate.sql.model.MutationTarget
getRolePath
-
-
-
-
Field Detail
-
qualifiedTableName
protected final String qualifiedTableName
-
hasWhere
protected final boolean hasWhere
-
sqlWhereString
protected final String sqlWhereString
-
indexContainsFormula
protected final boolean indexContainsFormula
-
elementIsPureFormula
protected final boolean elementIsPureFormula
-
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
-
identifierColumnName
protected final String identifierColumnName
-
isInverse
protected final boolean isInverse
-
batchSize
protected final int batchSize
-
sqlExceptionHelper
protected final SqlExceptionHelper sqlExceptionHelper
-
elementType
@Deprecated protected final Type elementType
Deprecated.
-
keyColumnAliases
@Deprecated protected final String[] keyColumnAliases
Deprecated.
-
indexColumnAliases
@Deprecated protected final String[] indexColumnAliases
Deprecated.
-
elementColumnAliases
@Deprecated protected final String[] elementColumnAliases
Deprecated.
-
-
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
-
getNavigableRole
public NavigableRole getNavigableRole()
Description copied from interface:CollectionPersisterThe NavigableRole for this collection.- Specified by:
getNavigableRolein interfaceCollectionPersister- Specified by:
getNavigableRolein interfaceMutationTarget<CollectionTableMapping>
-
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)
-
getCacheAccessStrategy
public CollectionDataAccess getCacheAccessStrategy()
Description copied from interface:CollectionPersisterAccess to the collection's cache region- Specified by:
getCacheAccessStrategyin interfaceCollectionPersister
-
hasCache
public boolean hasCache()
Description copied from interface:CollectionPersisterIs this collection role cacheable- Specified by:
hasCachein interfaceCollectionPersister
-
getRowMutationOperations
protected abstract RowMutationOperations getRowMutationOperations()
-
getRemoveCoordinator
protected abstract RemoveCoordinator getRemoveCoordinator()
-
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
-
getElementClass
public Class<?> getElementClass()
Return the element class of an array, or null otherwise. needed by arrays- Specified by:
getElementClassin interfaceCollectionPersister
-
decrementIndexByBase
@Deprecated(forRemoval=true) @Remove protected @Remove Object decrementIndexByBase(Object index)
Deprecated, for removal: This API element is subject to removal in a future version.No longer used.
-
isPrimitiveArray
public boolean isPrimitiveArray()
Description copied from interface:CollectionPersisterIs this an array or primitive values?- Specified by:
isPrimitiveArrayin interfaceCollectionMetadata- Specified by:
isPrimitiveArrayin interfaceCollectionPersister
-
isArray
public boolean isArray()
Description copied from interface:CollectionPersisterIs this an array?- Specified by:
isArrayin interfaceCollectionMetadata- Specified by:
isArrayin interfaceCollectionPersister
-
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:CollectionPersisterIs this an "indexed" collection? (list or map)- Specified by:
hasIndexin interfaceCollectionMetadata- Specified by:
hasIndexin interfaceCollectionPersister
-
isLazy
public boolean isLazy()
Description copied from interface:CollectionPersisterIs this 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
-
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
-
isRowInsertEnabled
protected boolean isRowInsertEnabled()
-
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
@Deprecated public IdentifierGenerator getIdentifierGenerator()
Deprecated.Description copied from interface:CollectionPersisterGet the surrogate key generation strategy (optional operation)- Specified by:
getIdentifierGeneratorin interfaceCollectionPersister
-
getGenerator
public BeforeExecutionGenerator getGenerator()
Description copied from interface:CollectionPersisterGet the surrogate key generation strategy (optional operation)- Specified by:
getGeneratorin 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.- 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 String[] getCollectionSpaces()
Description copied from interface:CollectionPersisterGet the "space" that holds the persistent state- Specified by:
getCollectionSpacesin interfaceCollectionPersister
-
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
-
isVersioned
public boolean isVersioned()
Description copied from interface:CollectionPersisterDoes this collection cause version increment of the owning entity?- Specified by:
isVersionedin interfaceCollectionPersister
-
getSQLExceptionHelper
protected SqlExceptionHelper getSQLExceptionHelper()
-
getCacheEntryStructure
public CacheEntryStructure getCacheEntryStructure()
Description copied from interface:CollectionPersisterGet the structure used to store data into the collection's cache region- 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)
Allows injection of the corresponding plural-attribute mapping.- Specified by:
injectAttributeMappingin interfacePluralAttributeMappingImpl.Aware- Implementation Note:
- Helps solve the chicken-egg problem of which to create first. Ultimately we could
make this work in a similar fashion to how this works in the relationship between
EmbeddableMappingTypeandEmbeddableValuedModelPart.
-
getAttributeMapping
public PluralAttributeMapping getAttributeMapping()
- Specified by:
getAttributeMappingin interfaceCollectionPersister
-
registerAffectingFetchProfile
public void registerAffectingFetchProfile(String fetchProfileName, Fetch.Style fetchStyle)
Description copied from interface:FetchProfileAffecteeRegister the profile name with the entity/collection- Specified by:
registerAffectingFetchProfilein interfaceFetchProfileAffectee
-
isAffectedByEnabledFetchProfiles
public boolean isAffectedByEnabledFetchProfiles(LoadQueryInfluencers influencers)
- Specified by:
isAffectedByEnabledFetchProfilesin interfaceCollectionPersister
-
isAffectedByEnabledFilters
public boolean isAffectedByEnabledFilters(LoadQueryInfluencers influencers)
- Specified by:
isAffectedByEnabledFiltersin interfaceCollectionPersister
-
isAffectedByEntityGraph
public boolean isAffectedByEntityGraph(LoadQueryInfluencers influencers)
- Specified by:
isAffectedByEntityGraphin interfaceCollectionPersister
-
getCollectionSemantics
public CollectionSemantics<?,?> getCollectionSemantics()
- Specified by:
getCollectionSemanticsin interfaceCollectionPersister
-
getTargetPart
public PluralAttributeMapping getTargetPart()
Description copied from interface:MutationTargetThe ModelPart describing the mutation target- Specified by:
getTargetPartin interfaceCollectionMutationTarget- Specified by:
getTargetPartin interfaceMutationTarget<CollectionTableMapping>
-
getIdentifierTableName
public String getIdentifierTableName()
Description copied from interface:MutationTargetThe name of the table defining the identifier for this target- Specified by:
getIdentifierTableNamein interfaceMutationTarget<CollectionTableMapping>
-
getCollectionTableMapping
public CollectionTableMapping getCollectionTableMapping()
- Specified by:
getCollectionTableMappingin interfaceCollectionMutationTarget
-
hasPhysicalIndexColumn
public boolean hasPhysicalIndexColumn()
Description copied from interface:CollectionMutationTargetWhether the collection has at least one physical index column- Specified by:
hasPhysicalIndexColumnin interfaceCollectionMutationTarget
-
forEachMutableTable
public void forEachMutableTable(Consumer<CollectionTableMapping> consumer)
Description copied from interface:MutationTargetVisit each table.- Specified by:
forEachMutableTablein interfaceMutationTarget<CollectionTableMapping>
-
forEachMutableTableReverse
public void forEachMutableTableReverse(Consumer<CollectionTableMapping> consumer)
Description copied from interface:MutationTargetSame asMutationTarget.forEachMutableTable(java.util.function.Consumer<T>)except that here the tables are visited in reverse order- Specified by:
forEachMutableTableReversein interfaceMutationTarget<CollectionTableMapping>
-
buildDeleteAllOperation
protected JdbcMutationOperation buildDeleteAllOperation(MutatingTableReference tableReference)
-
generateDeleteAllAst
public RestrictedTableMutation<JdbcMutationOperation> generateDeleteAllAst(MutatingTableReference tableReference)
-
getCollectionType
public CollectionType getCollectionType()
Description copied from interface:CollectionPersisterGet the associatedType- Specified by:
getCollectionTypein interfaceCollectionPersister
-
getKeyType
public Type getKeyType()
Description copied from interface:CollectionPersisterGet the "key" type (the type of the foreign key)- Specified by:
getKeyTypein interfaceCollectionMetadata- Specified by:
getKeyTypein interfaceCollectionPersister
-
getIdentifierType
public Type getIdentifierType()
Description copied from interface:CollectionPersisterGet the type of the surrogate key- Specified by:
getIdentifierTypein interfaceCollectionPersister
-
getIndexType
public Type getIndexType()
Description copied from interface:CollectionPersisterGet the "index" type for a list or map (optional operation)- Specified by:
getIndexTypein interfaceCollectionMetadata- Specified by:
getIndexTypein interfaceCollectionPersister
-
getElementType
public Type getElementType()
Description copied from interface:CollectionPersisterGet the "element" type- Specified by:
getElementTypein interfaceCollectionMetadata- Specified by:
getElementTypein 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.
-
-