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
@Incubating public interface CollectionSemantics<CE,E>
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default 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 semanticsCollectionClassification
getCollectionClassification()
The classification handled by this semanticClass<?>
getCollectionJavaType()
The collection's Java typeIterator<E>
getElementIterator(CE rawCollection)
Obtain an iterator over the collection elementsCE
instantiateRaw(int anticipatedSize, CollectionPersister collectionDescriptor)
Create a raw (unwrapped) version of the collectionPersistentCollection<E>
instantiateWrapper(Object key, CollectionPersister collectionDescriptor, SharedSessionContractImplementor session)
Create a wrapper for the collectionvoid
visitElements(CE rawCollection, Consumer<? super E> action)
Visit the elements of the collectionPersistentCollection<E>
wrap(CE rawCollection, CollectionPersister collectionDescriptor, SharedSessionContractImplementor session)
Wrap a raw collection in wrapper
-
-
-
Method Detail
-
getCollectionClassification
CollectionClassification getCollectionClassification()
The classification handled by this semantic
-
getCollectionJavaType
Class<?> getCollectionJavaType()
The collection's Java type
-
instantiateRaw
CE instantiateRaw(int anticipatedSize, CollectionPersister collectionDescriptor)
Create a raw (unwrapped) version of the collection
-
instantiateWrapper
PersistentCollection<E> instantiateWrapper(Object key, CollectionPersister collectionDescriptor, SharedSessionContractImplementor session)
Create a wrapper for the collection
-
wrap
PersistentCollection<E> wrap(CE rawCollection, CollectionPersister collectionDescriptor, SharedSessionContractImplementor session)
Wrap a raw collection in wrapper
-
getElementIterator
Iterator<E> getElementIterator(CE rawCollection)
Obtain an iterator over the collection elements
-
visitElements
void visitElements(CE rawCollection, Consumer<? super E> action)
Visit the elements of the collection
-
createInitializerProducer
default CollectionInitializerProducer createInitializerProducer(NavigablePath navigablePath, PluralAttributeMapping attributeMapping, FetchParent fetchParent, boolean selected, String resultVariable, DomainResultCreationState creationState)
Create a producer forCollectionInitializer
instances for the given collection semantics- See Also:
InitializerProducerBuilder
-
createInitializerProducer
default 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 semantics- See Also:
InitializerProducerBuilder
-
-