Class NaturalIdMultiLoadAccessStandard<T>
- All Implemented Interfaces:
MultiLoadOptions,MultiNaturalIdLoadOptions,NaturalIdMultiLoadAccess<T>
-
Constructor Summary
ConstructorsConstructorDescriptionNaturalIdMultiLoadAccessStandard(EntityPersister entityDescriptor, SharedSessionContractImplementor session) -
Method Summary
Modifier and TypeMethodDescriptionenableOrderedReturn(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...)?enableReturnOfDeletedEntities(boolean enabled) ShouldNaturalIdMultiLoadAccess.multiLoad(java.lang.Object...)return entity instances that have beenmarked for removalin the current session, but not yet deleted in the database?Batch size to use when loading entities from the database.Specify the lock options applied during loading.booleanShould the entities be returned in the same order as their associated entity identifiers were provided.booleanShould we returned entities that are scheduled for deletion.Retrieve the entities with the given natural id values.Retrieve the entities with the given natural id values.with(EntityGraph<T> graph, GraphSemantic semantic) Customize the associations fetched by specifying an entity graph, and how it should be interpreted.Specify the timeout to use when querying the database.Specify theCacheModeto use when obtaining an entity.with(LockMode lockMode, PessimisticLockScope lockScope) Specify the lock mode to use when querying the database.with(LockOptions lockOptions) Specify the lock options to use when querying the database.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, waitMethods inherited from interface org.hibernate.NaturalIdMultiLoadAccess
with, with, withFetchGraph, withLoadGraph
-
Constructor Details
-
Method Details
-
with
Description copied from interface:NaturalIdMultiLoadAccessSpecify the lock mode to use when querying the database.- Specified by:
within interfaceNaturalIdMultiLoadAccess<T>- Parameters:
lockMode- The lock mode to apply- Returns:
this, for method chaining
-
with
Description copied from interface:NaturalIdMultiLoadAccessSpecify the timeout to use when querying the database.- Specified by:
within interfaceNaturalIdMultiLoadAccess<T>- Parameters:
timeout- The timeout to apply to the database operation- Returns:
this, for method chaining
-
with
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
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
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
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
Description copied from interface:NaturalIdMultiLoadAccessShouldNaturalIdMultiLoadAccess.multiLoad(java.lang.Object...)return entity instances that have beenmarked for removalin the current session, but not yet deleted 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
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
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
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
Description copied from interface:MultiLoadOptionsSpecify the lock options applied during loading.- Specified by:
getLockOptionsin interfaceMultiLoadOptions- Returns:
- lock options applied during loading.
-
getBatchSize
Description copied from interface:MultiLoadOptionsBatch size to use when loading entities from the database.- Specified by:
getBatchSizein interfaceMultiLoadOptions- Returns:
- JDBC batch size
-