org.hibernate.type

Class ArrayType

Implemented Interfaces:
AssociationType, Serializable, Type

public class ArrayType
extends CollectionType

A type for persistent arrays.
Author:
Gavin King

Field Summary

Fields inherited from class org.hibernate.type.CollectionType

UNFETCHED_COLLECTION

Constructor Summary

ArrayType(String role, String propertyRef, Class elementClass, boolean isEmbeddedInXML)

Method Summary

Iterator
getElementsIterator(Object collection)
Not defined for collections of primitive type
Class
getReturnedClass()
The class returned by nullSafeGet() methods.
boolean
hasHolder(EntityMode entityMode)
Object
indexOf(Object array, Object element)
protected boolean
initializeImmediately(EntityMode entityMode)
Object
instantiate(int anticipatedSize)
PersistentCollection
instantiate(SessionImplementor session, CollectionPersister persister, Serializable key)
Object
instantiateResult(Object original)
boolean
isArrayType()
Object
replaceElements(Object original, Object target, Object owner, Map copyCache, SessionImplementor session)
String
toLoggableString(Object value, SessionFactoryImplementor factory)
A representation of the value to be embedded in a log file.
PersistentCollection
wrap(SessionImplementor session, Object array)

Methods inherited from class org.hibernate.type.CollectionType

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 inherited from class 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

Constructor Details

ArrayType

public ArrayType(String role,
                 String propertyRef,
                 Class elementClass,
                 boolean isEmbeddedInXML)

Method Details

getElementsIterator

public Iterator getElementsIterator(Object collection)
Not defined for collections of primitive type
Overrides:
getElementsIterator in interface CollectionType

getReturnedClass

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

hasHolder

public boolean hasHolder(EntityMode entityMode)
Overrides:
hasHolder in interface CollectionType

indexOf

public Object indexOf(Object array,
                      Object element)
Overrides:
indexOf in interface CollectionType

initializeImmediately

protected boolean initializeImmediately(EntityMode entityMode)
Overrides:
initializeImmediately in interface CollectionType

instantiate

public Object instantiate(int anticipatedSize)
Overrides:
instantiate in interface CollectionType

instantiate

public PersistentCollection instantiate(SessionImplementor session,
                                        CollectionPersister persister,
                                        Serializable key)
            throws HibernateException
Overrides:
instantiate in interface CollectionType

instantiateResult

public Object instantiateResult(Object original)
Overrides:
instantiateResult in interface CollectionType

isArrayType

public boolean isArrayType()
Overrides:
isArrayType in interface CollectionType

replaceElements

public Object replaceElements(Object original,
                              Object target,
                              Object owner,
                              Map copyCache,
                              SessionImplementor session)
            throws HibernateException
Overrides:
replaceElements in interface CollectionType

toLoggableString

public String toLoggableString(Object value,
                               SessionFactoryImplementor factory)
            throws HibernateException
A representation of the value to be embedded in a log file.
Specified by:
toLoggableString in interface Type
Overrides:
toLoggableString in interface CollectionType
Parameters:
value -
factory -
Returns:
String

wrap

public PersistentCollection wrap(SessionImplementor session,
                                 Object array)
Overrides:
wrap in interface CollectionType