Class NaturalIdMultiLoadAccessStandard<T>
- java.lang.Object
-
- org.hibernate.internal.NaturalIdMultiLoadAccessStandard<T>
-
- All Implemented Interfaces:
MultiLoadOptions,MultiNaturalIdLoadOptions,NaturalIdMultiLoadAccess<T>
public class NaturalIdMultiLoadAccessStandard<T> extends Object implements NaturalIdMultiLoadAccess<T>, MultiNaturalIdLoadOptions
-
-
Constructor Summary
Constructors Constructor Description NaturalIdMultiLoadAccessStandard(EntityPersister entityDescriptor, SessionImpl session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NaturalIdMultiLoadAccess<T>enableOrderedReturn(boolean enabled)Should the returned list of entity instances be ordered, with the position of an entity instance determined by the position of its identifier in the list if ids passed toNaturalIdMultiLoadAccess.multiLoad(java.lang.Object...)?NaturalIdMultiLoadAccess<T>enableReturnOfDeletedEntities(boolean enabled)ShouldNaturalIdMultiLoadAccess.multiLoad(java.lang.Object...)return entity instances that have beenmarked for removalin the current session, but not yetdeleted in the database?IntegergetBatchSize()Batch size to use when loading entities from the database.LockOptionsgetLockOptions()Specify the lock options applied during loading.booleanisOrderReturnEnabled()Should the entities be returned in the same order as their associated entity identifiers were provided.booleanisReturnOfDeletedEntitiesEnabled()Should we returned entities that are scheduled for deletion.List<T>multiLoad(Object... ids)Retrieve the entities with the given natural id values.List<T>multiLoad(List<?> ids)Retrieve the entities with the given natural id values.NaturalIdMultiLoadAccess<T>with(CacheMode cacheMode)Specify theCacheModeto use when obtaining an entity.NaturalIdMultiLoadAccess<T>with(RootGraph<T> graph, GraphSemantic semantic)Customize the associations fetched by specifying an entity graph, and how it should be interpreted.NaturalIdMultiLoadAccess<T>with(LockOptions lockOptions)Specify the lock options to use when querying the database.NaturalIdMultiLoadAccess<T>withBatchSize(int batchSize)Specify a batch size, that is, how many entities should be fetched in each request to the database.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.NaturalIdMultiLoadAccess
with, withFetchGraph, withLoadGraph
-
-
-
-
Constructor Detail
-
NaturalIdMultiLoadAccessStandard
public NaturalIdMultiLoadAccessStandard(EntityPersister entityDescriptor, SessionImpl session)
-
-
Method Detail
-
with
public NaturalIdMultiLoadAccess<T> with(LockOptions lockOptions)
Description copied from interface:NaturalIdMultiLoadAccessSpecify the lock options to use when querying the database.- Specified by:
within interfaceNaturalIdMultiLoadAccess<T>- Parameters:
lockOptions- The lock options to use- Returns:
this, for method chaining
-
with
public NaturalIdMultiLoadAccess<T> with(CacheMode cacheMode)
Description copied from interface:NaturalIdMultiLoadAccessSpecify theCacheModeto use when obtaining an entity.- Specified by:
within interfaceNaturalIdMultiLoadAccess<T>- Parameters:
cacheMode- TheCacheModeto use- Returns:
this, for method chaining
-
with
public NaturalIdMultiLoadAccess<T> with(RootGraph<T> graph, GraphSemantic semantic)
Description copied from interface:NaturalIdMultiLoadAccessCustomize the associations fetched by specifying an entity graph, and how it should be interpreted.- Specified by:
within interfaceNaturalIdMultiLoadAccess<T>
-
withBatchSize
public NaturalIdMultiLoadAccess<T> withBatchSize(int batchSize)
Description copied from interface:NaturalIdMultiLoadAccessSpecify a batch size, that is, how many entities should be fetched in each request to the database.- By default, the batch sizing strategy is determined by the SQL dialect, but
- if some
batchSize>1is specified as an argument to this method, then that batch size will be used.
If an explicit batch size is set manually, care should be taken to not exceed the capabilities of the underlying database.
A batch size is considered a hint.
- Specified by:
withBatchSizein interfaceNaturalIdMultiLoadAccess<T>- Parameters:
batchSize- The batch size- Returns:
this, for method chaining
-
enableReturnOfDeletedEntities
public NaturalIdMultiLoadAccess<T> enableReturnOfDeletedEntities(boolean enabled)
Description copied from interface:NaturalIdMultiLoadAccessShouldNaturalIdMultiLoadAccess.multiLoad(java.lang.Object...)return entity instances that have beenmarked for removalin the current session, but not yetdeleted in the database?By default, instances marked for removal are replaced by null in the returned list of entities when
NaturalIdMultiLoadAccess.enableOrderedReturn(boolean)is used.- Specified by:
enableReturnOfDeletedEntitiesin interfaceNaturalIdMultiLoadAccess<T>- Parameters:
enabled-trueif removed entities should be returned;falseif they should be replaced by null values.- Returns:
this, for method chaining
-
enableOrderedReturn
public NaturalIdMultiLoadAccess<T> enableOrderedReturn(boolean enabled)
Description copied from interface:NaturalIdMultiLoadAccessShould the returned list of entity instances be ordered, with the position of an entity instance determined by the position of its identifier in the list if ids passed toNaturalIdMultiLoadAccess.multiLoad(java.lang.Object...)?By default, the returned list is ordered and the positions of the entities correspond to the positions of their ids. In this case, the handling of entities marked for removal becomes important.
- Specified by:
enableOrderedReturnin interfaceNaturalIdMultiLoadAccess<T>- Parameters:
enabled-trueif entity instances should be ordered;falseif they may be returned in any order.- Returns:
this, for method chaining
-
multiLoad
public List<T> multiLoad(Object... ids)
Description copied from interface:NaturalIdMultiLoadAccessRetrieve the entities with the given natural id values.Note that the options
NaturalIdMultiLoadAccess.enableReturnOfDeletedEntities(boolean)andNaturalIdMultiLoadAccess.enableOrderedReturn(boolean)affect the size and shape of the returned list of entity instances.- Specified by:
multiLoadin interfaceNaturalIdMultiLoadAccess<T>- Parameters:
ids- The natural id values to load- Returns:
- The managed entities.
-
multiLoad
public List<T> multiLoad(List<?> ids)
Description copied from interface:NaturalIdMultiLoadAccessRetrieve the entities with the given natural id values.Note that the options
NaturalIdMultiLoadAccess.enableReturnOfDeletedEntities(boolean)andNaturalIdMultiLoadAccess.enableOrderedReturn(boolean)affect the size and shape of the returned list of entity instances.- Specified by:
multiLoadin interfaceNaturalIdMultiLoadAccess<T>- Parameters:
ids- The natural id values to load- Returns:
- The managed entities.
-
isReturnOfDeletedEntitiesEnabled
public boolean isReturnOfDeletedEntitiesEnabled()
Description copied from interface:MultiLoadOptionsShould we returned entities that are scheduled for deletion.- Specified by:
isReturnOfDeletedEntitiesEnabledin interfaceMultiLoadOptions- Returns:
- entities that are scheduled for deletion are returned as well.
-
isOrderReturnEnabled
public boolean isOrderReturnEnabled()
Description copied from interface:MultiLoadOptionsShould the entities be returned in the same order as their associated entity identifiers were provided.- Specified by:
isOrderReturnEnabledin interfaceMultiLoadOptions- Returns:
- entities follow the provided identifier order
-
getLockOptions
public LockOptions getLockOptions()
Description copied from interface:MultiLoadOptionsSpecify the lock options applied during loading.- Specified by:
getLockOptionsin interfaceMultiLoadOptions- Returns:
- lock options applied during loading.
-
getBatchSize
public Integer getBatchSize()
Description copied from interface:MultiLoadOptionsBatch size to use when loading entities from the database.- Specified by:
getBatchSizein interfaceMultiLoadOptions- Returns:
- JDBC batch size
-
-