站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

OneToManyPersister (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.collection
Class OneToManyPersister

java.lang.Object
  extended bynet.sf.hibernate.collection.AbstractCollectionPersister
      extended bynet.sf.hibernate.collection.OneToManyPersister
All Implemented Interfaces:
CollectionMetadata, CollectionPersister, Joinable, PropertyMapping, QueryableCollection

public class OneToManyPersister
extends AbstractCollectionPersister

Collection persister for one-to-many associations.

Author:
Gavin King

Field Summary
 
Fields inherited from class net.sf.hibernate.collection.AbstractCollectionPersister
batchSize, elementColumnAliases, elementColumnNames, elementPersister, elementType, hasIdentifier, hasIndex, hasWhere, identifierColumnName, indexColumnAliases, indexColumnNames, keyColumnAliases, keyColumnNames, qualifiedTableName, rowSelectColumnNames, sqlWhereString
 
Constructor Summary
OneToManyPersister(Collection collection, Configuration cfg, SessionFactoryImplementor factory)
           
 
Method Summary
 boolean consumesAlias()
          Ugly, very ugly....
protected  CollectionInitializer createCollectionInitializer(SessionFactoryImplementor factory)
          Create the OneToManyLoader
protected  int doUpdateRows(Serializable id, PersistentCollection collection, SessionImplementor session)
           
 String fromJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses)
          Get the from clause part of any joins (optional operation)
protected  String generateDeleteRowString()
          Generate the SQL UPDATE that updates a particular row's foreign key to null
protected  String generateDeleteString()
          Generate the SQL UPDATE that updates all the foreign keys to null
protected  String generateInsertRowString()
          Generate the SQL UPDATE that updates a foreign key to a value
protected  String generateUpdateRowString()
          Not needed for one-to-many association
 boolean isManyToMany()
          Is this instance actually a many-to-many association?
 boolean isOneToMany()
          Is this a one-to-many association?
 String selectFragment(String alias, String suffix, boolean includeCollectionColumns)
          All columns to select, when loading.
 String whereJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses)
          Get the where clause part of any joins (optional operation)
 
Methods inherited from class net.sf.hibernate.collection.AbstractCollectionPersister
convert, deleteRows, enableJoinedFetch, getCache, getCollectionMetadata, getCollectionSpace, getCollectionType, getElementClass, getElementColumnNames, getElementPersister, getElementType, getIdentifierGenerator, getIdentifierType, getIndexColumnNames, getIndexType, getJoinKeyColumnNames, getKeyColumnNames, getKeyType, getName, getOwnerClass, getRole, getSQLDeleteRowString, getSQLDeleteString, getSQLInsertRowString, getSQLOrderByString, getSQLUpdateRowString, getSQLWhereString, getTableName, getType, hasCache, hasIndex, hasOrdering, hasOrphanDelete, hasWhere, initialize, insertRows, isArray, isCollection, isInverse, isLazy, isPrimitiveArray, readElement, readIdentifier, readIndex, readKey, recreate, remove, selectFragment, toColumns, toString, toType, updateRows, writeElement, writeIdentifier, writeIndex, writeKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OneToManyPersister

public OneToManyPersister(Collection collection,
                          Configuration cfg,
                          SessionFactoryImplementor factory)
                   throws MappingException,
                          CacheException
Method Detail

generateDeleteString

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

Specified by:
generateDeleteString in class AbstractCollectionPersister

generateInsertRowString

protected String generateInsertRowString()
Generate the SQL UPDATE that updates a foreign key to a value

Specified by:
generateInsertRowString in class AbstractCollectionPersister

generateUpdateRowString

protected String generateUpdateRowString()
Not needed for one-to-many association

Specified by:
generateUpdateRowString in class AbstractCollectionPersister

generateDeleteRowString

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

Specified by:
generateDeleteRowString in class AbstractCollectionPersister

consumesAlias

public boolean consumesAlias()
Description copied from interface: Joinable
Ugly, very ugly....


isOneToMany

public boolean isOneToMany()
Description copied from interface: CollectionPersister
Is this a one-to-many association?


isManyToMany

public boolean isManyToMany()
Description copied from interface: Joinable
Is this instance actually a many-to-many association?


doUpdateRows

protected int doUpdateRows(Serializable id,
                           PersistentCollection collection,
                           SessionImplementor session)
                    throws HibernateException
Specified by:
doUpdateRows in class AbstractCollectionPersister
Throws:
HibernateException

selectFragment

public String selectFragment(String alias,
                             String suffix,
                             boolean includeCollectionColumns)
Description copied from interface: Joinable
All columns to select, when loading.


createCollectionInitializer

protected CollectionInitializer createCollectionInitializer(SessionFactoryImplementor factory)
                                                     throws MappingException
Create the OneToManyLoader

Specified by:
createCollectionInitializer in class AbstractCollectionPersister
Throws:
MappingException
See Also:
OneToManyLoader

fromJoinFragment

public String fromJoinFragment(String alias,
                               boolean innerJoin,
                               boolean includeSubclasses)
Description copied from interface: Joinable
Get the from clause part of any joins (optional operation)


whereJoinFragment

public String whereJoinFragment(String alias,
                                boolean innerJoin,
                                boolean includeSubclasses)
Description copied from interface: Joinable
Get the where clause part of any joins (optional operation)