Class BasicCollectionPersister
- java.lang.Object
-
- org.hibernate.persister.collection.AbstractCollectionPersister
-
- org.hibernate.persister.collection.BasicCollectionPersister
-
- All Implemented Interfaces:
CollectionMetadata,CollectionPersister,QueryableCollection,SQLLoadableCollection,Joinable,PropertyMapping,CollectionDefinition
public class BasicCollectionPersister extends AbstractCollectionPersister
Collection persister for collections of values and many-to-many associations.
-
-
Field Summary
-
Fields inherited from class org.hibernate.persister.collection.AbstractCollectionPersister
batchSize, elementColumnAliases, elementColumnIsGettable, elementColumnIsInPrimaryKey, elementColumnIsSettable, elementColumnNames, elementColumnReaders, elementColumnReaderTemplates, elementColumnWriters, elementFormulas, elementFormulaTemplates, elementIsPureFormula, elementType, hasIdentifier, hasIndex, hasWhere, identifierColumnName, indexColumnAliases, indexColumnIsGettable, indexColumnIsSettable, indexColumnNames, indexContainsFormula, indexFormulas, indexFormulaTemplates, isInverse, keyColumnAliases, keyColumnNames, qualifiedTableName, recreateBatchKey, sqlExceptionHelper, sqlWhereString
-
-
Constructor Summary
Constructors Constructor Description BasicCollectionPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconsumesCollectionAlias()Very, very, very ugly...booleanconsumesEntityAlias()Very, very, very ugly...protected CollectionInitializercreateCollectionInitializer(LoadQueryInfluencers loadQueryInfluencers)Create the CollectionLoaderprotected CollectionInitializercreateSubselectInitializer(SubselectFetch subselect, SharedSessionContractImplementor session)protected voiddoProcessQueuedOps(PersistentCollection collection, java.io.Serializable id, SharedSessionContractImplementor session)protected intdoUpdateRows(java.io.Serializable id, PersistentCollection collection, SharedSessionContractImplementor session)java.lang.StringfromJoinFragment(java.lang.String alias, boolean innerJoin, boolean includeSubclasses)Get the from clause part of any joins (optional operation)java.lang.StringfromJoinFragment(java.lang.String alias, boolean innerJoin, boolean includeSubclasses, java.util.Set<java.lang.String> treatAsDeclarations)Get the from clause part of any joins (optional operation)protected java.lang.StringgenerateDeleteRowString()Generate the SQL DELETE that deletes a particular rowprotected java.lang.StringgenerateDeleteString()Generate the SQL DELETE that deletes all rowsprotected java.lang.StringgenerateInsertRowString()Generate the SQL INSERT that creates a new rowprotected java.lang.StringgenerateUpdateRowString()Generate the SQL UPDATE that updates a roworg.hibernate.internal.FilterAliasGeneratorgetFilterAliasGenerator(java.lang.String rootAlias)booleanisCascadeDeleteEnabled()Is cascade delete handled by the database-level foreign key constraint definition?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.booleanisOneToMany()Is this a one-to-many association?java.lang.StringselectFragment(Joinable rhs, java.lang.String rhsAlias, java.lang.String lhsAlias, java.lang.String entitySuffix, java.lang.String collectionSuffix, boolean includeCollectionColumns)All columns to select, when loading.java.lang.StringwhereJoinFragment(java.lang.String alias, boolean innerJoin, boolean includeSubclasses)Get the where clause part of any joins (optional operation)java.lang.StringwhereJoinFragment(java.lang.String alias, boolean innerJoin, boolean includeSubclasses, java.util.Set<java.lang.String> treatAsDeclarations)Get the where clause part of any joins (optional operation)-
Methods inherited from class org.hibernate.persister.collection.AbstractCollectionPersister
appendElementColumns, appendIdentifierColumns, appendIndexColumns, createDelete, createInsert, createUpdate, decrementIndexByBase, deleteRows, determineTableName, doProcessQueuedOps, elementExists, filterFragment, filterFragment, filterFragment, filterFragment, generateDetectRowByElementString, generateDetectRowByIndexString, generateSelectFragment, generateSelectRowByIndexString, generateSelectSizeString, getAppropriateInitializer, getBatchSize, getCacheAccessStrategy, getCacheEntryStructure, getCollectionMetadata, getCollectionPersister, getCollectionPropertyColumnAliases, getCollectionSpaces, getCollectionType, getDeleteAllCheckStyle, getDeleteCheckStyle, getDialect, getElementByIndex, getElementClass, getElementColumnAliases, getElementColumnNames, getElementColumnNames, getElementDefinition, getElementPersister, getElementType, getFactory, getFetchMode, getIdentifierColumnAlias, getIdentifierColumnName, getIdentifierGenerator, getIdentifierType, getIndexColumnAliases, getIndexColumnNames, getIndexColumnNames, getIndexDefinition, getIndexFormulas, getIndexType, getInitializer, getInsertCheckStyle, getKeyColumnAliases, getKeyColumnNames, getKeyType, getManyToManyFilterFragment, getManyToManyOrderByString, getMappedByProperty, getName, getNavigableRole, getOwnerEntityName, getOwnerEntityPersister, getRole, getSize, getSQLDeleteRowString, getSQLDeleteString, getSQLExceptionConverter, getSQLExceptionHelper, getSQLInsertRowString, getSQLOrderByString, getSQLUpdateRowString, getSQLWhereString, getTableName, getType, getUpdateCheckStyle, hasCache, hasIndex, hasManyToManyOrdering, hasOrdering, hasOrphanDelete, hasWhere, incrementIndexByBase, indexExists, initCollectionPropertyMap, initialize, insertRows, isAffectedByEnabledFilters, isArray, isCollection, isDeleteAllCallable, isDeleteCallable, isExtraLazy, isInsertCallable, isInverse, isLazy, isMutable, isPrimitiveArray, isRowDeleteEnabled, isRowInsertEnabled, isSubselectLoadable, isUpdateCallable, isVersioned, logStaticSQL, oneToManyFilterFragment, oneToManyFilterFragment, postInstantiate, processQueuedOps, readElement, readIdentifier, readIndex, readKey, recreate, remove, selectFragment, toColumns, toColumns, toString, toType, updateRows, writeElement, writeElementToWhere, writeIdentifier, writeIndex, writeIndexToWhere, writeKey
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.persister.entity.Joinable
fromJoinFragment
-
-
-
-
Constructor Detail
-
BasicCollectionPersister
public BasicCollectionPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext) throws MappingException, CacheException
- Throws:
MappingExceptionCacheException
-
-
Method Detail
-
isCascadeDeleteEnabled
public boolean isCascadeDeleteEnabled()
Description copied from interface:CollectionPersisterIs cascade delete handled by the database-level foreign key constraint definition?
-
generateDeleteString
protected java.lang.String generateDeleteString()
Generate the SQL DELETE that deletes all rows- Specified by:
generateDeleteStringin classAbstractCollectionPersister
-
generateInsertRowString
protected java.lang.String generateInsertRowString()
Generate the SQL INSERT that creates a new row- Specified by:
generateInsertRowStringin classAbstractCollectionPersister
-
generateUpdateRowString
protected java.lang.String generateUpdateRowString()
Generate the SQL UPDATE that updates a row- Specified by:
generateUpdateRowStringin classAbstractCollectionPersister
-
doProcessQueuedOps
protected void doProcessQueuedOps(PersistentCollection collection, java.io.Serializable id, SharedSessionContractImplementor session)
- Specified by:
doProcessQueuedOpsin classAbstractCollectionPersister
-
generateDeleteRowString
protected java.lang.String generateDeleteRowString()
Generate the SQL DELETE that deletes a particular row- Specified by:
generateDeleteRowStringin classAbstractCollectionPersister
-
consumesEntityAlias
public boolean consumesEntityAlias()
Description copied from interface:JoinableVery, very, very ugly...- Returns:
- Does this persister "consume" entity column aliases in the result set?
-
consumesCollectionAlias
public boolean consumesCollectionAlias()
Description copied from interface:JoinableVery, very, very ugly...- Returns:
- Does this persister "consume" collection column aliases in the result set?
-
isOneToMany
public boolean isOneToMany()
Description copied from interface:CollectionPersisterIs this a one-to-many association?
-
isManyToMany
public 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- Specified by:
isManyToManyin classAbstractCollectionPersister
-
doUpdateRows
protected int doUpdateRows(java.io.Serializable id, PersistentCollection collection, SharedSessionContractImplementor session) throws HibernateException- Specified by:
doUpdateRowsin classAbstractCollectionPersister- Throws:
HibernateException
-
selectFragment
public java.lang.String selectFragment(Joinable rhs, java.lang.String rhsAlias, java.lang.String lhsAlias, java.lang.String entitySuffix, java.lang.String collectionSuffix, boolean includeCollectionColumns)
Description copied from interface:JoinableAll columns to select, when loading.
-
createCollectionInitializer
protected CollectionInitializer createCollectionInitializer(LoadQueryInfluencers loadQueryInfluencers) throws MappingException
Create the CollectionLoader- Specified by:
createCollectionInitializerin classAbstractCollectionPersister- Throws:
MappingException- See Also:
BasicCollectionLoader
-
fromJoinFragment
public java.lang.String fromJoinFragment(java.lang.String alias, boolean innerJoin, boolean includeSubclasses)Description copied from interface:JoinableGet the from clause part of any joins (optional operation)
-
fromJoinFragment
public java.lang.String fromJoinFragment(java.lang.String alias, boolean innerJoin, boolean includeSubclasses, java.util.Set<java.lang.String> treatAsDeclarations)Description copied from interface:JoinableGet the from clause part of any joins (optional operation)
-
whereJoinFragment
public java.lang.String whereJoinFragment(java.lang.String alias, boolean innerJoin, boolean includeSubclasses)Description copied from interface:JoinableGet the where clause part of any joins (optional operation)
-
whereJoinFragment
public java.lang.String whereJoinFragment(java.lang.String alias, boolean innerJoin, boolean includeSubclasses, java.util.Set<java.lang.String> treatAsDeclarations)Description copied from interface:JoinableGet the where clause part of any joins (optional operation)
-
createSubselectInitializer
protected CollectionInitializer createSubselectInitializer(SubselectFetch subselect, SharedSessionContractImplementor session)
- Specified by:
createSubselectInitializerin classAbstractCollectionPersister
-
getFilterAliasGenerator
public org.hibernate.internal.FilterAliasGenerator getFilterAliasGenerator(java.lang.String rootAlias)
- Specified by:
getFilterAliasGeneratorin classAbstractCollectionPersister
-
-