public interface

UserCollectionType

org.hibernate.usertype.UserCollectionType

Class Overview

A custom type for mapping user-written classes that implement PersistentCollection

Summary

Public Methods
abstract boolean contains(Object collection, Object entity)
Optional operation.
abstract Iterator getElementsIterator(Object collection)
Return an iterator over the elements of this collection - the passed collection instance may or may not be a wrapper
abstract Object indexOf(Object collection, Object entity)
Optional operation.
abstract Object instantiate(int anticipatedSize)
Instantiate an empty instance of the "underlying" collection (not a wrapper), but with the given anticipated size (i.e.
abstract PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister)
Instantiate an uninitialized instance of the collection wrapper
abstract Object replaceElements(Object original, Object target, CollectionPersister persister, Object owner, Map copyCache, SessionImplementor session)
Replace the elements of a collection with the elements of another collection
abstract PersistentCollection wrap(SessionImplementor session, Object collection)
Wrap an instance of a collection

Public Methods

public abstract boolean contains (Object collection, Object entity)

Optional operation. Does the collection contain the entity instance?

public abstract Iterator getElementsIterator (Object collection)

Return an iterator over the elements of this collection - the passed collection instance may or may not be a wrapper

public abstract Object indexOf (Object collection, Object entity)

Optional operation. Return the index of the entity in the collection.

public abstract 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 size and perhaps load factor).

Parameters
anticipatedSize The anticipated size of the instaniated collection after we are done populating it. Note, may be negative to indicate that we not yet know anything about the anticipated size (i.e., when initializing from a result set row by row).

public abstract PersistentCollection instantiate (SessionImplementor session, CollectionPersister persister)

Instantiate an uninitialized instance of the collection wrapper

public abstract Object replaceElements (Object original, Object target, CollectionPersister persister, Object owner, Map copyCache, SessionImplementor session)

Replace the elements of a collection with the elements of another collection

public abstract PersistentCollection wrap (SessionImplementor session, Object collection)

Wrap an instance of a collection