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
public interface CollectionSemantics<CE,E>Describes the semantics of a persistent collection such that Hibernate understands how to use it - create one, handle elements, etc.- Since:
- 6.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CollectionInitializerProducercreateInitializerProducer(NavigablePath navigablePath, PluralAttributeMapping attributeMapping, FetchParent fetchParent, boolean selected, String resultVariable, DomainResultCreationState creationState)Create a producer forCollectionInitializerinstances for the given collection semanticsdefault CollectionInitializerProducercreateInitializerProducer(NavigablePath navigablePath, PluralAttributeMapping attributeMapping, FetchParent fetchParent, boolean selected, String resultVariable, Fetch indexFetch, Fetch elementFetch, DomainResultCreationState creationState)Create a producer forCollectionInitializerinstances for the given collection semanticsCollectionClassificationgetCollectionClassification()The classification handled by this semanticClass<?>getCollectionJavaType()The collection's Java typeIterator<E>getElementIterator(CE rawCollection)Obtain an iterator over the collection elementsCEinstantiateRaw(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 collectionvoidvisitElements(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 forCollectionInitializerinstances 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 forCollectionInitializerinstances for the given collection semantics- See Also:
InitializerProducerBuilder
-
-