Class OneToManyPersister
java.lang.Object
org.hibernate.persister.collection.AbstractCollectionPersister
org.hibernate.persister.collection.OneToManyPersister
- All Implemented Interfaces:
CollectionMetadata,CollectionPersister,QueryableCollection,SQLLoadableCollection,Joinable,PropertyMapping
Collection persister for one-to-many associations.
-
Field Summary
Fields inherited from class org.hibernate.persister.collection.AbstractCollectionPersister
batchSize, elementColumnAliases, elementColumnIsInPrimaryKey, elementColumnIsSettable, elementColumnNames, elementColumnReaders, elementColumnReaderTemplates, elementColumnWriters, elementFormulas, elementFormulaTemplates, elementIsPureFormula, elementType, hasIdentifier, hasIndex, hasWhere, identifierColumnName, indexColumnAliases, indexColumnIsSettable, indexColumnNames, indexContainsFormula, indexFormulas, indexFormulaTemplates, keyColumnAliases, keyColumnNames, qualifiedTableName, sqlWhereString -
Constructor Summary
ConstructorsConstructorDescriptionOneToManyPersister(Collection collection, CollectionRegionAccessStrategy cacheAccessStrategy, Configuration cfg, SessionFactoryImplementor factory) -
Method Summary
Modifier and TypeMethodDescriptionbooleanVery, very, very ugly...booleanVery, very, very ugly...protected CollectionInitializercreateCollectionInitializer(LoadQueryInfluencers loadQueryInfluencers) Create the OneToManyLoaderprotected CollectionInitializercreateSubselectInitializer(SubselectFetch subselect, SessionImplementor session) protected intdoUpdateRows(Serializable id, PersistentCollection collection, SessionImplementor session) filterFragment(String alias) fromJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses) Get the from clause part of any joins (optional operation)protected StringGenerate the SQL UPDATE that updates a particular row's foreign key to nullprotected StringGenerate the SQL UPDATE that updates all the foreign keys to nullprotected StringGenerate the SQL UPDATE that updates a foreign key to a valueprotected StringNot needed for one-to-many associationgetElementByIndex(Serializable key, Object index, SessionImplementor session, Object owner) The table to join to.booleanIs cascade delete handled by the database-level foreign key constraint definition?booleanIs this a many-to-many association? Note that this is mainly a convenience feature as the single persister does not conatin all the information needed to handle a many-to-many itself, as internally it is looked at as two many-to-ones.booleanIs this a one-to-many association?protected booleanprotected booleanselectFragment(Joinable rhs, String rhsAlias, String lhsAlias, String entitySuffix, String collectionSuffix, boolean includeCollectionColumns) All columns to select, when loading.whereJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses) Get the where clause part of any joins (optional operation)Methods inherited from class org.hibernate.persister.collection.AbstractCollectionPersister
appendElementColumns, appendIdentifierColumns, appendIndexColumns, decrementIndexByBase, deleteRows, elementExists, filterFragment, generateDetectRowByElementString, generateDetectRowByIndexString, generateSelectFragment, generateSelectRowByIndexString, generateSelectSizeString, getAppropriateInitializer, getCacheAccessStrategy, getCacheEntryStructure, getCollectionMetadata, getCollectionPropertyColumnAliases, getCollectionSpaces, getCollectionType, getDeleteAllCheckStyle, getDeleteCheckStyle, getDialect, getElementClass, getElementColumnAliases, getElementColumnNames, getElementColumnNames, getElementNodeName, getElementPersister, getElementType, getFactory, getFetchMode, getIdentifierColumnAlias, getIdentifierColumnName, getIdentifierGenerator, getIdentifierType, getIndexColumnAliases, getIndexColumnNames, getIndexColumnNames, getIndexFormulas, getIndexNodeName, getIndexType, getInitializer, getInsertCheckStyle, getKeyColumnAliases, getKeyColumnNames, getKeyType, getManyToManyFilterFragment, getManyToManyOrderByString, getName, getNodeName, getOwnerEntityName, getOwnerEntityPersister, getRole, getSize, getSQLDeleteRowString, getSQLDeleteString, getSQLExceptionConverter, getSQLInsertRowString, getSQLOrderByString, getSQLUpdateRowString, getSQLWhereString, getType, getUpdateCheckStyle, hasCache, hasIndex, hasManyToManyOrdering, hasOrdering, hasOrphanDelete, hasWhere, incrementIndexByBase, indexExists, initCollectionPropertyMap, initialize, insertRows, isAffectedByEnabledFilters, isArray, isCollection, isDeleteAllCallable, isDeleteCallable, isExtraLazy, isInsertCallable, isInverse, isLazy, isMutable, isPrimitiveArray, isSubselectLoadable, isUpdateCallable, isVersioned, logStaticSQL, oneToManyFilterFragment, postInstantiate, readElement, readIdentifier, readIndex, readKey, recreate, remove, selectFragment, toColumns, toColumns, toString, toType, updateRows, writeElement, writeElementToWhere, writeIdentifier, writeIndex, writeIndexToWhere, writeKey
-
Constructor Details
-
OneToManyPersister
public OneToManyPersister(Collection collection, CollectionRegionAccessStrategy cacheAccessStrategy, Configuration cfg, SessionFactoryImplementor factory) throws MappingException, CacheException - Throws:
MappingExceptionCacheException
-
-
Method Details
-
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
Generate the SQL UPDATE that updates all the foreign keys to null- Specified by:
generateDeleteStringin classAbstractCollectionPersister
-
generateInsertRowString
Generate the SQL UPDATE that updates a foreign key to a value- Specified by:
generateInsertRowStringin classAbstractCollectionPersister
-
generateUpdateRowString
Not needed for one-to-many association- Specified by:
generateUpdateRowStringin classAbstractCollectionPersister
-
generateDeleteRowString
Generate the SQL UPDATE that updates a particular row's foreign key to null- 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 conatin 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(Serializable id, PersistentCollection collection, SessionImplementor session) throws HibernateException - Specified by:
doUpdateRowsin classAbstractCollectionPersister- Throws:
HibernateException
-
selectFragment
public String selectFragment(Joinable rhs, String rhsAlias, String lhsAlias, String entitySuffix, String collectionSuffix, boolean includeCollectionColumns) Description copied from interface:JoinableAll columns to select, when loading. -
createCollectionInitializer
protected CollectionInitializer createCollectionInitializer(LoadQueryInfluencers loadQueryInfluencers) throws MappingException Create the OneToManyLoader- Specified by:
createCollectionInitializerin classAbstractCollectionPersister- Throws:
MappingException- See Also:
-
fromJoinFragment
Description copied from interface:JoinableGet the from clause part of any joins (optional operation) -
whereJoinFragment
Description copied from interface:JoinableGet the where clause part of any joins (optional operation) -
getTableName
Description copied from interface:JoinableThe table to join to.- Specified by:
getTableNamein interfaceJoinable- Overrides:
getTableNamein classAbstractCollectionPersister
-
filterFragment
- Overrides:
filterFragmentin classAbstractCollectionPersister- Throws:
MappingException
-
createSubselectInitializer
protected CollectionInitializer createSubselectInitializer(SubselectFetch subselect, SessionImplementor session) - Specified by:
createSubselectInitializerin classAbstractCollectionPersister
-
getElementByIndex
public Object getElementByIndex(Serializable key, Object index, SessionImplementor session, Object owner) - Specified by:
getElementByIndexin interfaceCollectionPersister- Overrides:
getElementByIndexin classAbstractCollectionPersister
-