Package org.hibernate.usertype
Interface UserCollectionType
public interface UserCollectionType
A custom type for mapping user-written classes which implement
PersistentCollection
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Optional operation.The classification mapped by this custom typeClass<?>
The Java type that this type maps.Iterator<?>
getElementsIterator
(Object collection) Return an iterator over the elements of this collection - the passed collection instance may or may not be a wrapperOptional operation.instantiate
(int anticipatedSize) Instantiate an empty instance of the "underlying" collection (not a wrapper), but with the given anticipated size (i.e.instantiate
(SharedSessionContractImplementor session, CollectionPersister persister) Instantiate an uninitialized instance of the collection wrapperreplaceElements
(Object original, Object target, CollectionPersister persister, Object owner, Map copyCache, SharedSessionContractImplementor session) Replace the elements of a collection with the elements of another collectionwrap
(SharedSessionContractImplementor session, Object collection) Wrap an instance of a collection
-
Method Details
-
getClassification
CollectionClassification getClassification()The classification mapped by this custom type -
getCollectionClass
Class<?> getCollectionClass()The Java type that this type maps. -
getElementsIterator
Return an iterator over the elements of this collection - the passed collection instance may or may not be a wrapper -
contains
Optional operation. Does the collection contain the entity instance? -
indexOf
Optional operation. Return the index of the entity in the collection. -
instantiate
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 instantiated 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).
-