Class NaturalIdMultiLoadAccessStandard<T>
- All Implemented Interfaces:
MultiLoadOptions
,MultiNaturalIdLoadOptions
,NaturalIdMultiLoadAccess<T>
-
Constructor Summary
ConstructorDescriptionNaturalIdMultiLoadAccessStandard
(EntityPersister entityDescriptor, SessionImpl 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 removal
in the current session, but not yetdelete
d in the database?Batch size to use when loading entities from the database.Specify the lock options applied during loading.boolean
Should the entities be returned in the same order as their associated entity identifiers were provided.boolean
Should 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.Specify theCacheMode
to use when obtaining an entity.with
(RootGraph<T> graph, GraphSemantic semantic) Customize the associations fetched by specifying an entity graph, and how it should be interpreted.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, wait
Methods inherited from interface org.hibernate.NaturalIdMultiLoadAccess
with, withFetchGraph, withLoadGraph
-
Constructor Details
-
NaturalIdMultiLoadAccessStandard
-
-
Method Details
-
with
Description copied from interface:NaturalIdMultiLoadAccess
Specify the lock options to use when querying the database.- Specified by:
with
in interfaceNaturalIdMultiLoadAccess<T>
- Parameters:
lockOptions
- The lock options to use- Returns:
this
, for method chaining
-
with
Description copied from interface:NaturalIdMultiLoadAccess
Specify theCacheMode
to use when obtaining an entity.- Specified by:
with
in interfaceNaturalIdMultiLoadAccess<T>
- Parameters:
cacheMode
- TheCacheMode
to use- Returns:
this
, for method chaining
-
with
Description copied from interface:NaturalIdMultiLoadAccess
Customize the associations fetched by specifying an entity graph, and how it should be interpreted.- Specified by:
with
in interfaceNaturalIdMultiLoadAccess<T>
-
withBatchSize
Description copied from interface:NaturalIdMultiLoadAccess
Specify 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>1
is 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:
withBatchSize
in interfaceNaturalIdMultiLoadAccess<T>
- Parameters:
batchSize
- The batch size- Returns:
this
, for method chaining
-
enableReturnOfDeletedEntities
Description copied from interface:NaturalIdMultiLoadAccess
ShouldNaturalIdMultiLoadAccess.multiLoad(java.lang.Object...)
return entity instances that have beenmarked for removal
in the current session, but not yetdelete
d 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:
enableReturnOfDeletedEntities
in interfaceNaturalIdMultiLoadAccess<T>
- Parameters:
enabled
-true
if removed entities should be returned;false
if they should be replaced by null values.- Returns:
this
, for method chaining
-
enableOrderedReturn
Description copied from interface:NaturalIdMultiLoadAccess
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...)
?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:
enableOrderedReturn
in interfaceNaturalIdMultiLoadAccess<T>
- Parameters:
enabled
-true
if entity instances should be ordered;false
if they may be returned in any order.- Returns:
this
, for method chaining
-
multiLoad
Description copied from interface:NaturalIdMultiLoadAccess
Retrieve 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:
multiLoad
in interfaceNaturalIdMultiLoadAccess<T>
- Parameters:
ids
- The natural id values to load- Returns:
- The managed entities.
-
multiLoad
Description copied from interface:NaturalIdMultiLoadAccess
Retrieve 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:
multiLoad
in interfaceNaturalIdMultiLoadAccess<T>
- Parameters:
ids
- The natural id values to load- Returns:
- The managed entities.
-
isReturnOfDeletedEntitiesEnabled
public boolean isReturnOfDeletedEntitiesEnabled()Description copied from interface:MultiLoadOptions
Should we returned entities that are scheduled for deletion.- Specified by:
isReturnOfDeletedEntitiesEnabled
in interfaceMultiLoadOptions
- Returns:
- entities that are scheduled for deletion are returned as well.
-
isOrderReturnEnabled
public boolean isOrderReturnEnabled()Description copied from interface:MultiLoadOptions
Should the entities be returned in the same order as their associated entity identifiers were provided.- Specified by:
isOrderReturnEnabled
in interfaceMultiLoadOptions
- Returns:
- entities follow the provided identifier order
-
getLockOptions
Description copied from interface:MultiLoadOptions
Specify the lock options applied during loading.- Specified by:
getLockOptions
in interfaceMultiLoadOptions
- Returns:
- lock options applied during loading.
-
getBatchSize
Description copied from interface:MultiLoadOptions
Batch size to use when loading entities from the database.- Specified by:
getBatchSize
in interfaceMultiLoadOptions
- Returns:
- JDBC batch size
-