Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » type » [javadoc | source]
org.hibernate.type
abstract public class: CollectionType [javadoc | source]
java.lang.Object
   org.hibernate.type.AbstractType
      org.hibernate.type.CollectionType

All Implemented Interfaces:
    AssociationType, Type

Direct Known Subclasses:
    ArrayType, BagType, SetType, CustomCollectionType, SortedMapType, ListType, OrderedSetType, IdentifierBagType, OrderedMapType, SortedSetType, MapType

A type that handles Hibernate PersistentCollections (including arrays).
Field Summary
public static final  Object UNFETCHED_COLLECTION     
Constructor:
 public CollectionType(String role,
    String foreignKeyPropertyName,
    boolean isEmbeddedInXML) 
Method from org.hibernate.type.CollectionType Summary:
assemble,   compare,   contains,   deepCopy,   disassemble,   fromXMLNode,   getAssociatedEntityName,   getAssociatedJoinable,   getCollection,   getColumnSpan,   getElementType,   getElementsIterator,   getElementsIterator,   getForeignKeyDirection,   getHashCode,   getIdOfOwnerOrNull,   getKeyOfOwner,   getLHSPropertyName,   getName,   getOnCondition,   getRHSUniqueKeyPropertyName,   getRole,   hasHolder,   hydrate,   indexOf,   initializeImmediately,   instantiate,   instantiate,   instantiateResult,   isAlwaysDirtyChecked,   isArrayType,   isAssociationType,   isCollectionType,   isDirty,   isDirty,   isEmbeddedInXML,   isEqual,   isModified,   isMutable,   isXMLElement,   nullSafeGet,   nullSafeGet,   nullSafeSet,   nullSafeSet,   renderLoggableString,   replace,   replaceElements,   resolve,   semiResolve,   setToXMLNode,   sqlTypes,   toColumnNullness,   toLoggableString,   toString,   useLHSPrimaryKey,   wrap
Methods from org.hibernate.type.AbstractType:
assemble,   beforeAssemble,   compare,   disassemble,   getHashCode,   getHashCode,   getSemiResolvedType,   hydrate,   isAnyType,   isAssociationType,   isCollectionType,   isComponentType,   isDirty,   isEntityType,   isEqual,   isEqual,   isModified,   isSame,   isXMLElement,   replace,   replaceNode,   resolve,   semiResolve
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.type.CollectionType Detail:
 public Object assemble(Serializable cached,
    SessionImplementor session,
    Object owner) throws HibernateException 
 public int compare(Object x,
    Object y,
    EntityMode entityMode) 
 public boolean contains(Object collection,
    Object childObject,
    SessionImplementor session) 
 public Object deepCopy(Object value,
    EntityMode entityMode,
    SessionFactoryImplementor factory) throws HibernateException 
 public Serializable disassemble(Object value,
    SessionImplementor session,
    Object owner) throws HibernateException 
 public Object fromXMLNode(Node xml,
    Mapping factory) throws HibernateException 
 public String getAssociatedEntityName(SessionFactoryImplementor factory) throws MappingException 
 public Joinable getAssociatedJoinable(SessionFactoryImplementor factory) throws MappingException 
 public Object getCollection(Serializable key,
    SessionImplementor session,
    Object owner) 
    instantiate a collection wrapper (called when loading an object)
 public int getColumnSpan(Mapping session) throws MappingException 
 public final Type getElementType(SessionFactoryImplementor factory) throws MappingException 
    Get the Hibernate type of the collection elements
 protected Iterator getElementsIterator(Object collection) 
    Get an iterator over the element set of the collection in POJO mode
 public Iterator getElementsIterator(Object collection,
    SessionImplementor session) 
    Get an iterator over the element set of the collection, which may not yet be wrapped
 public ForeignKeyDirection getForeignKeyDirection() 
 public int getHashCode(Object x,
    EntityMode entityMode) 
 public Serializable getIdOfOwnerOrNull(Serializable key,
    SessionImplementor session) 
    Get the id value from the owning entity key, usually the same as the key, but might be some other property, in the case of property-ref
 public Serializable getKeyOfOwner(Object owner,
    SessionImplementor session) 
    Get the key value from the owning entity instance, usually the identifier, but might be some other unique key, in the case of property-ref
 public String getLHSPropertyName() 
 public String getName() 
 public String getOnCondition(String alias,
    SessionFactoryImplementor factory,
    Map enabledFilters) throws MappingException 
 public String getRHSUniqueKeyPropertyName() 
 public String getRole() 
 public boolean hasHolder(EntityMode entityMode) 
 public Object hydrate(ResultSet rs,
    String[] name,
    SessionImplementor session,
    Object owner) 
 public Object indexOf(Object collection,
    Object element) 
 protected boolean initializeImmediately(EntityMode entityMode) 
 abstract public Object instantiate(int anticipatedSize)
    Instantiate an empty instance of the "underlying" collection (not a wrapper), but with the given anticipated size (i.e. accounting for initial capacity and perhaps load factor).
 abstract public PersistentCollection instantiate(SessionImplementor session,
    CollectionPersister persister,
    Serializable key)
    Instantiate an uninitialized collection wrapper or holder. Callers MUST add the holder to the persistence context!
 protected Object instantiateResult(Object original) 
    Instantiate a new "underlying" collection exhibiting the same capacity charactersitcs and the passed "original".
 public boolean isAlwaysDirtyChecked() 
    We always need to dirty check the collection because we sometimes need to incremement version number of owner and also because of how assemble/disassemble is implemented for uks
 public boolean isArrayType() 
 public boolean isAssociationType() 
    Note: return true because this type is castable to AssociationType. Not because all collections are associations.
 public boolean isCollectionType() 
 public boolean isDirty(Object old,
    Object current,
    SessionImplementor session) throws HibernateException 
 public boolean isDirty(Object old,
    Object current,
    boolean[] checkable,
    SessionImplementor session) throws HibernateException 
 public boolean isEmbeddedInXML() 
 public final boolean isEqual(Object x,
    Object y,
    EntityMode entityMode) 
 public boolean isModified(Object old,
    Object current,
    boolean[] checkable,
    SessionImplementor session) throws HibernateException 
 public boolean isMutable() 
 public boolean isXMLElement() 
 public Object nullSafeGet(ResultSet rs,
    String name,
    SessionImplementor session,
    Object owner) throws SQLException 
 public Object nullSafeGet(ResultSet rs,
    String[] name,
    SessionImplementor session,
    Object owner) throws HibernateException, SQLException 
 public  void nullSafeSet(PreparedStatement st,
    Object value,
    int index,
    SessionImplementor session) throws HibernateException, SQLException 
 public final  void nullSafeSet(PreparedStatement st,
    Object value,
    int index,
    boolean[] settable,
    SessionImplementor session) throws HibernateException, SQLException 
 protected String renderLoggableString(Object value,
    SessionFactoryImplementor factory) throws HibernateException 
 public Object replace(Object original,
    Object target,
    SessionImplementor session,
    Object owner,
    Map copyCache) throws HibernateException 
    {@inheritDoc}
 public Object replaceElements(Object original,
    Object target,
    Object owner,
    Map copyCache,
    SessionImplementor session) 
    Replace the elements of a collection with the elements of another collection.
 public Object resolve(Object value,
    SessionImplementor session,
    Object owner) throws HibernateException 
 public Object semiResolve(Object value,
    SessionImplementor session,
    Object owner) throws HibernateException 
 public  void setToXMLNode(Node node,
    Object value,
    SessionFactoryImplementor factory) throws HibernateException 
 public int[] sqlTypes(Mapping session) throws MappingException 
 public boolean[] toColumnNullness(Object value,
    Mapping mapping) 
 public String toLoggableString(Object value,
    SessionFactoryImplementor factory) throws HibernateException 
 public String toString() 
 public boolean useLHSPrimaryKey() 
 abstract public PersistentCollection wrap(SessionImplementor session,
    Object collection)
    Wrap the naked collection instance in a wrapper, or instantiate a holder. Callers MUST add the holder to the persistence context!