Package org.hibernate.usertype
Interface UserCollectionType
-
public interface UserCollectionType
A custom type for mapping user-written classes that implement PersistentCollection- See Also:
PersistentCollection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(java.lang.Object collection, java.lang.Object entity)
Optional operation.java.util.Iterator
getElementsIterator(java.lang.Object collection)
Return an iterator over the elements of this collection - the passed collection instance may or may not be a wrapperjava.lang.Object
indexOf(java.lang.Object collection, java.lang.Object entity)
Optional operation.java.lang.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(SharedSessionContractImplementor session, CollectionPersister persister)
Instantiate an uninitialized instance of the collection wrapperjava.lang.Object
replaceElements(java.lang.Object original, java.lang.Object target, CollectionPersister persister, java.lang.Object owner, java.util.Map copyCache, SharedSessionContractImplementor session)
Replace the elements of a collection with the elements of another collectionPersistentCollection
wrap(SharedSessionContractImplementor session, java.lang.Object collection)
Wrap an instance of a collection
-
-
-
Method Detail
-
instantiate
PersistentCollection instantiate(SharedSessionContractImplementor session, CollectionPersister persister) throws HibernateException
Instantiate an uninitialized instance of the collection wrapper- Throws:
HibernateException
-
wrap
PersistentCollection wrap(SharedSessionContractImplementor session, java.lang.Object collection)
Wrap an instance of a collection
-
getElementsIterator
java.util.Iterator getElementsIterator(java.lang.Object collection)
Return an iterator over the elements of this collection - the passed collection instance may or may not be a wrapper
-
contains
boolean contains(java.lang.Object collection, java.lang.Object entity)
Optional operation. Does the collection contain the entity instance?
-
indexOf
java.lang.Object indexOf(java.lang.Object collection, java.lang.Object entity)
Optional operation. Return the index of the entity in the collection.
-
replaceElements
java.lang.Object replaceElements(java.lang.Object original, java.lang.Object target, CollectionPersister persister, java.lang.Object owner, java.util.Map copyCache, SharedSessionContractImplementor session) throws HibernateException
Replace the elements of a collection with the elements of another collection- Throws:
HibernateException
-
instantiate
java.lang.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).
-
-