Top Description Fields Constructors Methods
org.hibernate.persister.collection

public Class OneToManyPersister

extends AbstractCollectionPersister
Class Inheritance
Imports
java.io.Serializable, java.sql.PreparedStatement, .SQLException, java.util.Iterator, org.hibernate.HibernateException, .MappingException, org.hibernate.cache.CacheException, org.hibernate.cache.access.CollectionRegionAccessStrategy, org.hibernate.cfg.Configuration, org.hibernate.collection.PersistentCollection, org.hibernate.engine.SessionFactoryImplementor, .SessionImplementor, .SubselectFetch, .LoadQueryInfluencers, org.hibernate.exception.JDBCExceptionHelper, org.hibernate.jdbc.Expectation, .Expectations, org.hibernate.loader.collection.BatchingCollectionInitializer, .CollectionInitializer, .SubselectOneToManyLoader, org.hibernate.loader.entity.CollectionElementLoader, org.hibernate.mapping.Collection, org.hibernate.persister.entity.Joinable, .OuterJoinLoadable, org.hibernate.pretty.MessageHelper, org.hibernate.sql.Update, org.hibernate.util.ArrayHelper

Collection persister for one-to-many associations.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private final boolean
private final boolean
private final boolean
Inherited from org.hibernate.persister.collection.AbstractCollectionPersister:
batchSizeelementColumnAliaseselementColumnIsInPrimaryKeyelementColumnIsSettableelementColumnNameselementColumnReaderselementColumnReaderTemplateselementColumnWriterselementFormulaselementFormulaTemplateselementIsPureFormulaelementTypehasIdentifierhasIndexhasWhereidentifierColumnNameindexColumnAliasesindexColumnIsSettableindexColumnNamesindexContainsFormulaindexFormulasindexFormulaTemplateskeyColumnAliaseskeyColumnNamesqualifiedTableNamesqlWhereString

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
protected CollectionInitializer
protected CollectionInitializer
protected int
public String
public String
fromJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses)

Implements org.hibernate.persister.entity.Joinable.fromJoinFragment.

Get the from clause part of any joins (optional operation)
protected String
generateDeleteRowString()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.generateDeleteRowString.

Generate the SQL UPDATE that updates a particular row's foreign key to null
protected String
generateDeleteString()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.generateDeleteString.

Generate the SQL UPDATE that updates all the foreign keys to null
protected String
generateInsertRowString()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.generateInsertRowString.

Generate the SQL UPDATE that updates a foreign key to a value
protected String
public Object
public String
public boolean
isCascadeDeleteEnabled()

Implements org.hibernate.persister.collection.CollectionPersister.isCascadeDeleteEnabled.

Is cascade delete handled by the database-level foreign key constraint definition?
public boolean
public boolean
protected boolean
protected boolean
public String
selectFragment(Joinable rhs, String rhsAlias, String lhsAlias, String entitySuffix, String collectionSuffix, boolean includeCollectionColumns)

Implements org.hibernate.persister.entity.Joinable.selectFragment.

All columns to select, when loading.
public String
whereJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses)

Implements org.hibernate.persister.entity.Joinable.whereJoinFragment.

Get the where clause part of any joins (optional operation)
Inherited from org.hibernate.persister.collection.AbstractCollectionPersister:
appendElementColumnsappendIdentifierColumnsappendIndexColumnsdecrementIndexByBasedeleteRowselementExistsfilterFragmentgenerateDetectRowByElementStringgenerateDetectRowByIndexStringgenerateSelectFragmentgenerateSelectRowByIndexStringgenerateSelectSizeStringgetAppropriateInitializergetCacheAccessStrategygetCacheEntryStructuregetCollectionMetadatagetCollectionPropertyColumnAliasesgetCollectionSpacesgetCollectionTypegetDeleteAllCheckStylegetDeleteCheckStylegetDialectgetElementClassgetElementColumnAliasesgetElementColumnNamesgetElementColumnNamesgetElementNodeNamegetElementPersistergetElementTypegetFactorygetFetchModegetIdentifierColumnAliasgetIdentifierColumnNamegetIdentifierGeneratorgetIdentifierTypegetIndexColumnAliasesgetIndexColumnNamesgetIndexColumnNamesgetIndexFormulasgetIndexNodeNamegetIndexTypegetInitializergetInsertCheckStylegetKeyColumnAliasesgetKeyColumnNamesgetKeyTypegetManyToManyFilterFragmentgetManyToManyOrderByStringgetNamegetNodeNamegetOwnerEntityNamegetOwnerEntityPersistergetRolegetSizegetSQLDeleteRowStringgetSQLDeleteStringgetSQLExceptionConvertergetSQLInsertRowStringgetSQLOrderByStringgetSQLUpdateRowStringgetSQLWhereStringgetTypegetUpdateCheckStylehasCachehasIndexhasManyToManyOrderinghasOrderinghasOrphanDeletehasWhereincrementIndexByBaseindexExistsinitCollectionPropertyMapinitializeinsertRowsisAffectedByEnabledFiltersisArrayisCollectionisDeleteAllCallableisDeleteCallableisExtraLazyisInsertCallableisInverseisLazyisMutableisPrimitiveArrayisSubselectLoadableisUpdateCallableisVersionedlogStaticSQLoneToManyFilterFragmentpostInstantiatereadElementreadIdentifierreadIndexreadKeyrecreateremoveselectFragmenttoColumnstoColumnstoStringtoTypeupdateRowswriteElementwriteElementToWherewriteIdentifierwriteIndexwriteIndexToWherewriteKey

Field Detail

cascadeDeleteEnabledback to summary
private final boolean cascadeDeleteEnabled
keyIsNullableback to summary
private final boolean keyIsNullable
keyIsUpdateableback to summary
private final boolean keyIsUpdateable

Constructor Detail

OneToManyPersisterback to summary
public OneToManyPersister(Collection collection, CollectionRegionAccessStrategy cacheAccessStrategy, Configuration cfg, SessionFactoryImplementor factory) throws MappingException, CacheException

Method Detail

consumesCollectionAliasback to summary
public boolean consumesCollectionAlias()

Implements org.hibernate.persister.entity.Joinable.consumesCollectionAlias.

Doc from org.hibernate.persister.entity.Joinable.consumesCollectionAlias.

Very, very, very ugly...

Returns:boolean

Does this persister "consume" collection column aliases in the result set?

consumesEntityAliasback to summary
public boolean consumesEntityAlias()

Implements org.hibernate.persister.entity.Joinable.consumesEntityAlias.

Doc from org.hibernate.persister.entity.Joinable.consumesEntityAlias.

Very, very, very ugly...

Returns:boolean

Does this persister "consume" entity column aliases in the result set?

createCollectionInitializerback to summary
protected CollectionInitializer createCollectionInitializer(LoadQueryInfluencers loadQueryInfluencers) throws MappingException

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.createCollectionInitializer.

Create the OneToManyLoader

See Also
org.hibernate.loader.collection.OneToManyLoader
createSubselectInitializerback to summary
protected CollectionInitializer createSubselectInitializer(SubselectFetch subselect, SessionImplementor session)

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.createSubselectInitializer.

doUpdateRowsback to summary
protected int doUpdateRows(Serializable id, PersistentCollection collection, SessionImplementor session) throws HibernateException

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.doUpdateRows.

filterFragmentback to summary
public String filterFragment(String alias) throws MappingException

Overrides org.hibernate.persister.collection.AbstractCollectionPersister.filterFragment.

fromJoinFragmentback to summary
public String fromJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses)

Implements org.hibernate.persister.entity.Joinable.fromJoinFragment.

Doc from org.hibernate.persister.entity.Joinable.fromJoinFragment.

Get the from clause part of any joins (optional operation)

generateDeleteRowStringback to summary
protected String generateDeleteRowString()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.generateDeleteRowString.

Generate the SQL UPDATE that updates a particular row's foreign key to null

generateDeleteStringback to summary
protected String generateDeleteString()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.generateDeleteString.

Generate the SQL UPDATE that updates all the foreign keys to null

generateInsertRowStringback to summary
protected String generateInsertRowString()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.generateInsertRowString.

Generate the SQL UPDATE that updates a foreign key to a value

generateUpdateRowStringback to summary
protected String generateUpdateRowString()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.generateUpdateRowString.

Not needed for one-to-many association

getElementByIndexback to summary
public Object getElementByIndex(Serializable key, Object index, SessionImplementor session, Object owner)

Overrides org.hibernate.persister.collection.AbstractCollectionPersister.getElementByIndex.

Implements org.hibernate.persister.collection.CollectionPersister.getElementByIndex.

getTableNameback to summary
public String getTableName()

Overrides org.hibernate.persister.collection.AbstractCollectionPersister.getTableName.

Implements org.hibernate.persister.entity.Joinable.getTableName.

Doc from org.hibernate.persister.entity.Joinable.getTableName.

The table to join to.

isCascadeDeleteEnabledback to summary
public boolean isCascadeDeleteEnabled()

Implements org.hibernate.persister.collection.CollectionPersister.isCascadeDeleteEnabled.

Doc from org.hibernate.persister.collection.CollectionPersister.isCascadeDeleteEnabled.

Is cascade delete handled by the database-level foreign key constraint definition?

isManyToManyback to summary
public boolean isManyToMany()

Implements abstract org.hibernate.persister.collection.AbstractCollectionPersister.isManyToMany.

Implements org.hibernate.persister.collection.CollectionPersister.isManyToMany.

Doc from org.hibernate.persister.collection.CollectionPersister.isManyToMany.

Is 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.

isOneToManyback to summary
public boolean isOneToMany()

Implements org.hibernate.persister.collection.CollectionPersister.isOneToMany.

Doc from org.hibernate.persister.collection.CollectionPersister.isOneToMany.

Is this a one-to-many association?

isRowDeleteEnabledback to summary
protected boolean isRowDeleteEnabled()

Overrides org.hibernate.persister.collection.AbstractCollectionPersister.isRowDeleteEnabled.

isRowInsertEnabledback to summary
protected boolean isRowInsertEnabled()

Overrides org.hibernate.persister.collection.AbstractCollectionPersister.isRowInsertEnabled.

selectFragmentback to summary
public String selectFragment(Joinable rhs, String rhsAlias, String lhsAlias, String entitySuffix, String collectionSuffix, boolean includeCollectionColumns)

Implements org.hibernate.persister.entity.Joinable.selectFragment.

Doc from org.hibernate.persister.entity.Joinable.selectFragment.

All columns to select, when loading.

whereJoinFragmentback to summary
public String whereJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses)

Implements org.hibernate.persister.entity.Joinable.whereJoinFragment.

Doc from org.hibernate.persister.entity.Joinable.whereJoinFragment.

Get the where clause part of any joins (optional operation)