public class

MapType

extends CollectionType
java.lang.Object
   ↳ org.hibernate.type.AbstractType
     ↳ org.hibernate.type.CollectionType
       ↳ org.hibernate.type.MapType
Known Direct Subclasses

Summary

[Expand]
Inherited Fields
From class org.hibernate.type.CollectionType
Public Constructors
MapType(TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML)
Public Methods
Iterator getElementsIterator(Object collection)
Get an iterator over the element set of the collection in POJO mode
Class getReturnedClass()
Object indexOf(Object collection, 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 replaceElements(Object original, Object target, Object owner, Map copyCache, SessionImplementor session)
Replace the elements of a collection with the elements of another collection.
PersistentCollection wrap(SessionImplementor session, Object collection)
Wrap the naked collection instance in a wrapper, or instantiate a holder.
[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 MapType (TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML)

Public Methods

public Iterator getElementsIterator (Object collection)

Get an iterator over the element set of the collection in POJO mode

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

public Class getReturnedClass ()

public Object indexOf (Object collection, 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 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 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!

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