Package org.hibernate.collection.spi
Interface CollectionSemantics<CE,E>
- Type Parameters:
E
- the collection element or map key typeCE
- the type of the collection
- All Known Subinterfaces:
BagSemantics<BE,
,E> MapSemantics<MKV,
K, V>
- All Known Implementing Classes:
AbstractBagSemantics
,AbstractMapSemantics
,AbstractSetSemantics
,CustomCollectionTypeSemantics
,StandardArraySemantics
,StandardBagSemantics
,StandardIdentifierBagSemantics
,StandardListSemantics
,StandardMapSemantics
,StandardOrderedMapSemantics
,StandardOrderedSetSemantics
,StandardSetSemantics
,StandardSortedMapSemantics
,StandardSortedSetSemantics
Each instance of this interface describes the semantics of some sort of
persistent collection so that Hibernate understands how to manage the
lifecycle of instances of that sort of collection.
A collection type with semantics described by a CollectionSemantics
object need not be part of the Java Collections Framework.
- Since:
- 6.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault CollectionInitializerProducer
createInitializerProducer
(NavigablePath navigablePath, PluralAttributeMapping attributeMapping, FetchParent fetchParent, boolean selected, String resultVariable, DomainResultCreationState creationState) Create a producer forCollectionInitializer
instances for the given collection semanticsdefault CollectionInitializerProducer
createInitializerProducer
(NavigablePath navigablePath, PluralAttributeMapping attributeMapping, FetchParent fetchParent, boolean selected, String resultVariable, Fetch indexFetch, Fetch elementFetch, DomainResultCreationState creationState) Create a producer forCollectionInitializer
instances for the given collection semanticsThe classification handled by this semanticClass<?>
The collection's Java typegetElementIterator
(CE rawCollection) Obtain an iterator over the collection elementsinstantiateRaw
(int anticipatedSize, CollectionPersister collectionDescriptor) Create a raw (unwrapped) version of the collectioninstantiateWrapper
(Object key, CollectionPersister collectionDescriptor, SharedSessionContractImplementor session) Create a wrapper for the collectionvoid
visitElements
(CE rawCollection, Consumer<? super E> action) Visit the elements of the collectionwrap
(CE rawCollection, CollectionPersister collectionDescriptor, SharedSessionContractImplementor session) Wrap a raw collection in wrapper
-
Method Details
-
getCollectionClassification
CollectionClassification getCollectionClassification()The classification handled by this semantic -
getCollectionJavaType
Class<?> getCollectionJavaType()The collection's Java type -
instantiateRaw
Create a raw (unwrapped) version of the collection -
getElementIterator
Obtain an iterator over the collection elements -
visitElements
Visit the elements of the collection
-