public class

ArrayType

extends CollectionType
java.lang.Object
   ↳ org.hibernate.type.AbstractType
     ↳ org.hibernate.type.CollectionType
       ↳ org.hibernate.type.ArrayType

Class Overview

A type for persistent arrays.

Summary

[Expand]
Inherited Fields
From class org.hibernate.type.CollectionType
Public Constructors
ArrayType(TypeFactory.TypeScope typeScope, String role, String propertyRef, Class elementClass, boolean isEmbeddedInXML)
Public Methods
Iterator getElementsIterator(Object collection)
Not defined for collections of primitive type
Class getReturnedClass()
boolean hasHolder(EntityMode entityMode)
Object indexOf(Object array, Object element)
Object instantiate(int anticipatedSize)
Instantiate an empty instance of the "underlying" collection (not a wrapper), but with the given anticipated size (i.e.
PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key)
Instantiate an uninitialized collection wrapper or holder.
Object instantiateResult(Object original)
Instantiate a new "underlying" collection exhibiting the same capacity charactersitcs and the passed "original".
boolean isArrayType()
Object replaceElements(Object original, Object target, Object owner, Map copyCache, SessionImplementor session)
Replace the elements of a collection with the elements of another collection.
String toLoggableString(Object value, SessionFactoryImplementor factory)
A representation of the value to be embedded in a log file.
PersistentCollection wrap(SessionImplementor session, Object array)
Wrap the naked collection instance in a wrapper, or instantiate a holder.
Protected Methods
boolean initializeImmediately(EntityMode entityMode)
[Expand]
Inherited Methods
From class org.hibernate.type.CollectionType
From class org.hibernate.type.AbstractType
From class java.lang.Object
From interface org.hibernate.type.AssociationType
From interface org.hibernate.type.Type

Public Constructors

public ArrayType (TypeFactory.TypeScope typeScope, String role, String propertyRef, Class elementClass, boolean isEmbeddedInXML)

Public Methods

public Iterator getElementsIterator (Object collection)

Not defined for collections of primitive type

Parameters
collection The collection to be iterated
Returns
  • The iterator.

public Class getReturnedClass ()

public boolean hasHolder (EntityMode entityMode)

public Object indexOf (Object array, Object element)

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

Parameters
anticipatedSize The anticipated size of the instaniated collection after we are done populating it.
Returns
  • A newly instantiated collection to be wrapped.

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!

Parameters
session The session from which the request is originating.
persister The underlying collection persister (metadata)
key The owner key.
Returns
  • The instantiated collection.

public Object instantiateResult (Object original)

Instantiate a new "underlying" collection exhibiting the same capacity charactersitcs and the passed "original".

Parameters
original The original collection.
Returns
  • The newly instantiated collection.

public boolean isArrayType ()

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.

Parameters
original The 'source' of the replacement elements (where we copy from)
target The target of the replacement elements (where we copy to)
owner The owner of the collection being merged
copyCache The map of elements already replaced.
session The session from which the merge event originated.
Returns
  • The merged collection.

public String toLoggableString (Object value, SessionFactoryImplementor factory)

A representation of the value to be embedded in a log file.

Returns
  • String

public PersistentCollection wrap (SessionImplementor session, Object array)

Wrap the naked collection instance in a wrapper, or instantiate a holder. Callers MUST add the holder to the persistence context!

Parameters
session The session from which the request is originating.
array The bare collection to be wrapped.
Returns
  • The wrapped collection.

Protected Methods

protected boolean initializeImmediately (EntityMode entityMode)