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

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


net.sf.hibernate.type
Class ArrayType

java.lang.Object
  extended bynet.sf.hibernate.type.AbstractType
      extended bynet.sf.hibernate.type.PersistentCollectionType
          extended bynet.sf.hibernate.type.ArrayType
All Implemented Interfaces:
AssociationType, Serializable, Type

public class ArrayType
extends PersistentCollectionType

A type for persistent arrays.

Author:
Gavin King
See Also:
Serialized Form

Constructor Summary
ArrayType(String role, Class elementClass)
           
 
Method Summary
 Object copy(Object original, Object target, SessionImplementor session, Object owner, Map copiedAlready)
           
 Serializable disassemble(Object value, SessionImplementor session)
          Return a cacheable "disassembled" representation of the object.
 Iterator getElementsIterator(Object collection)
          Not defined for collections of primitive type
 Class getReturnedClass()
          The class returned by nullSafeGet() methods.
 PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister)
           
 boolean isArrayType()
           
 void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session)
          Write an instance of the mapped class to a prepared statement.
 String toString(Object value, SessionFactoryImplementor factory)
          A representation of the value to be embedded in an XML element.
 PersistentCollection wrap(SessionImplementor session, Object array)
           
 
Methods inherited from class net.sf.hibernate.type.PersistentCollectionType
assemble, deepCopy, equals, equals, fromString, getAssociatedClass, getColumnSpan, getElementType, getForeignKeyDirection, getJoinable, getName, getReferencedColumns, getRole, hashCode, hasNiceEquals, hydrate, isAssociationType, isDirty, isModified, isMutable, isPersistentCollectionType, nullSafeGet, nullSafeGet, resolveIdentifier, sqlTypes, toString, usePrimaryKeyAsForeignKey
 
Methods inherited from class net.sf.hibernate.type.AbstractType
isComponentType, isEntityType, isObjectType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.hibernate.type.Type
isComponentType, isEntityType, isObjectType
 

Constructor Detail

ArrayType

public ArrayType(String role,
                 Class elementClass)
Method Detail

getReturnedClass

public Class getReturnedClass()
Description copied from interface: Type
The class returned by nullSafeGet() methods. This is used to establish the class of an array of this type.

Returns:
Class

instantiate

public PersistentCollection instantiate(SessionImplementor session,
                                        CollectionPersister persister)
                                 throws HibernateException
Specified by:
instantiate in class PersistentCollectionType
Throws:
HibernateException

nullSafeSet

public void nullSafeSet(PreparedStatement st,
                        Object value,
                        int index,
                        SessionImplementor session)
                 throws HibernateException,
                        SQLException
Description copied from interface: Type
Write an instance of the mapped class to a prepared statement. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index.

Specified by:
nullSafeSet in interface Type
Overrides:
nullSafeSet in class PersistentCollectionType
Throws:
HibernateException
SQLException

getElementsIterator

public Iterator getElementsIterator(Object collection)
Not defined for collections of primitive type

Overrides:
getElementsIterator in class PersistentCollectionType

disassemble

public Serializable disassemble(Object value,
                                SessionImplementor session)
                         throws HibernateException
Description copied from interface: Type
Return a cacheable "disassembled" representation of the object.

Specified by:
disassemble in interface Type
Overrides:
disassemble in class PersistentCollectionType
Throws:
HibernateException

wrap

public PersistentCollection wrap(SessionImplementor session,
                                 Object array)
Specified by:
wrap in class PersistentCollectionType

isArrayType

public boolean isArrayType()
Overrides:
isArrayType in class PersistentCollectionType

toString

public String toString(Object value,
                       SessionFactoryImplementor factory)
                throws HibernateException
Description copied from interface: Type
A representation of the value to be embedded in an XML element.

Specified by:
toString in interface Type
Overrides:
toString in class PersistentCollectionType
Throws:
HibernateException

copy

public Object copy(Object original,
                   Object target,
                   SessionImplementor session,
                   Object owner,
                   Map copiedAlready)
            throws HibernateException
Specified by:
copy in interface Type
Overrides:
copy in class PersistentCollectionType
Throws:
HibernateException