Class OneToManyPersister
- java.lang.Object
-
- org.hibernate.persister.collection.AbstractCollectionPersister
-
- org.hibernate.persister.collection.OneToManyPersister
-
- All Implemented Interfaces:
CollectionMetadata,FilterRestrictable,PluralAttributeMappingImpl.Aware,Restrictable,WhereRestrictable,CollectionPersister,QueryableCollection,SQLLoadableCollection,Joinable,PropertyMapping
public class OneToManyPersister extends AbstractCollectionPersister
ACollectionPersisterforone-to-one associations.- See Also:
BasicCollectionPersister
-
-
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 OneToManyPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext)OneToManyPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState astCreationState)voidapplyWhereRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, SqlAstCreationState creationState)Apply theWhererestrictionsbooleanconsumesCollectionAlias()Very, very, very ugly...booleanconsumesEntityAlias()Very, very, very ugly...protected voiddoProcessQueuedOps(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)protected intdoUpdateRows(Object id, PersistentCollection<?> collection, SharedSessionContractImplementor session)protected StringgenerateDeleteRowString()Generate the SQL UPDATE that updates a particular row's foreign key to nullprotected StringgenerateDeleteString()Generate the SQL UPDATE that updates all the foreign keys to nullprotected StringgenerateInsertRowString()Generate the SQL UPDATE that updates a foreign key to a valueprotected StringgenerateUpdateRowString()Generate the SQL UPDATE that inserts a collection indexFilterAliasGeneratorgetFilterAliasGenerator(String rootAlias)FilterAliasGeneratorgetFilterAliasGenerator(TableGroup rootTableGroup)StringgetTableName()The table to join to.voidinsertRows(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)Insert the persistent state of any new collection elementsbooleanisCascadeDeleteEnabled()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?protected booleanisRowDeleteEnabled()protected booleanisRowInsertEnabled()voidrecreate(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session)(Re)create the collection's persistent state-
Methods inherited from class org.hibernate.persister.collection.AbstractCollectionPersister
applyBaseManyToManyRestrictions, applyBaseRestrictions, applyFilterRestrictions, createCollectionLoader, createDelete, createInsert, createSubSelectLoader, createUpdate, decrementIndexByBase, deleteRows, determineLoaderToUse, determineTableName, elementExists, generateDetectRowByElementString, generateDetectRowByIndexString, generateSelectSizeString, getAttributeMapping, getBatchSize, getCacheAccessStrategy, getCacheEntryStructure, getCollectionMetadata, getCollectionPropertyColumnAliases, getCollectionSemantics, getCollectionSpaces, getCollectionType, getDeleteAllCheckStyle, getDeleteCheckStyle, getDialect, getElementByIndex, getElementClass, getElementColumnAliases, getElementColumnNames, getElementColumnNames, getElementConverter, getElementPersister, getElementPersisterInternal, getElementType, getFactory, getFetchMode, getIdentifierColumnAlias, getIdentifierColumnName, getIdentifierGenerator, getIdentifierType, getIndexColumnAliases, getIndexColumnNames, getIndexColumnNames, getIndexConverter, getIndexFormulas, getIndexType, getInsertCheckStyle, getKeyColumnAliases, getKeyColumnNames, getKeyType, getManyToManyFilterFragment, getManyToManyOrderByString, getMappedByProperty, getName, getNavigableRole, getOwnerEntityName, getOwnerEntityPersister, getRole, getSize, getSortingComparator, getSQLDeleteRowString, getSQLDeleteString, getSQLExceptionConverter, getSQLExceptionHelper, getSQLInsertRowString, getSQLOrderByString, getSQLUpdateRowString, getStandardCollectionLoader, getUpdateCheckStyle, hasCache, hasIndex, hasManyToManyOrdering, hasOrdering, hasOrphanDelete, hasWhere, incrementIndexByBase, indexExists, initCollectionPropertyMap, initialize, injectAttributeMapping, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEnabledFilters, isAffectedByEntityGraph, isArray, isCollection, isDeleteAllCallable, isDeleteCallable, isExtraLazy, isInsertCallable, isInverse, isLazy, isMutable, isPrimitiveArray, isSubselectLoadable, isUpdateCallable, isVersioned, logStaticSQL, needsRemove, postInstantiate, processQueuedOps, remove, selectFragment, toColumns, toString, toType, updateRows, writeElement, writeElementToWhere, writeIdentifier, writeIndex, writeIndexToWhere, writeKey
-
-
-
-
Constructor Detail
-
OneToManyPersister
@Deprecated(since="6.0") public OneToManyPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, PersisterCreationContext creationContext) throws MappingException, CacheException
Deprecated.- Throws:
MappingExceptionCacheException
-
OneToManyPersister
public OneToManyPersister(Collection collectionBinding, CollectionDataAccess cacheAccessStrategy, RuntimeModelCreationContext creationContext) throws MappingException, CacheException
- Throws:
MappingExceptionCacheException
-
-
Method Detail
-
isRowDeleteEnabled
protected boolean isRowDeleteEnabled()
- Overrides:
isRowDeleteEnabledin classAbstractCollectionPersister
-
isRowInsertEnabled
protected boolean isRowInsertEnabled()
- Overrides:
isRowInsertEnabledin classAbstractCollectionPersister
-
isCascadeDeleteEnabled
public boolean isCascadeDeleteEnabled()
Description copied from interface:CollectionPersisterIs cascade delete handled by the database-level foreign key constraint definition?
-
generateDeleteString
protected String generateDeleteString()
Generate the SQL UPDATE that updates all the foreign keys to null- Specified by:
generateDeleteStringin classAbstractCollectionPersister
-
generateInsertRowString
protected String generateInsertRowString()
Generate the SQL UPDATE that updates a foreign key to a value- Specified by:
generateInsertRowStringin classAbstractCollectionPersister
-
generateUpdateRowString
protected String generateUpdateRowString()
Generate the SQL UPDATE that inserts a collection index- Specified by:
generateUpdateRowStringin classAbstractCollectionPersister
-
generateDeleteRowString
protected String generateDeleteRowString()
Generate the SQL UPDATE that updates a particular row's foreign key to null- Specified by:
generateDeleteRowStringin classAbstractCollectionPersister
-
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- Overrides:
recreatein classAbstractCollectionPersister- Throws:
HibernateException
-
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- Overrides:
insertRowsin classAbstractCollectionPersister- Throws:
HibernateException
-
doProcessQueuedOps
protected void doProcessQueuedOps(PersistentCollection<?> collection, Object id, SharedSessionContractImplementor session) throws HibernateException
- Specified by:
doProcessQueuedOpsin classAbstractCollectionPersister- Throws:
HibernateException
-
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(Object id, PersistentCollection<?> collection, SharedSessionContractImplementor session)
- Specified by:
doUpdateRowsin classAbstractCollectionPersister
-
getTableName
public String getTableName()
Description copied from interface:JoinableThe table to join to.- Specified by:
getTableNamein interfaceJoinable- Overrides:
getTableNamein classAbstractCollectionPersister
-
applyWhereRestrictions
public void applyWhereRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, SqlAstCreationState creationState)
Description copied from interface:WhereRestrictableApply theWhererestrictions- Specified by:
applyWhereRestrictionsin interfaceWhereRestrictable- Overrides:
applyWhereRestrictionsin classAbstractCollectionPersister
-
applyWhereFragments
protected void applyWhereFragments(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState astCreationState)
- Overrides:
applyWhereFragmentsin classAbstractCollectionPersister
-
getFilterAliasGenerator
public FilterAliasGenerator getFilterAliasGenerator(String rootAlias)
- Specified by:
getFilterAliasGeneratorin classAbstractCollectionPersister
-
getFilterAliasGenerator
public FilterAliasGenerator getFilterAliasGenerator(TableGroup rootTableGroup)
- Specified by:
getFilterAliasGeneratorin classAbstractCollectionPersister
-
-