Interface MultiIdentifierLoadAccess<T>
var graph = session.createEntityGraph(Book.class); graph.addSubgraph(Book_.publisher); List<Book> books = session.byMultipleIds(Book.class) .withFetchGraph(graph) .withBatchSize(20) .multiLoad(bookIds);
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondisableFetchProfile
(String profileName) Deprecated, for removal: This API element is subject to removal in a future version.Customize the associations fetched by specifying a fetch profile that should be disabled during this operation.enableFetchProfile
(String profileName) Deprecated, for removal: This API element is subject to removal in a future version.Customize the associations fetched by specifying a fetch profile that should be enabled during this operation.enableOrderedReturn
(boolean enabled) Deprecated, for removal: This API element is subject to removal in a future version.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 tomultiLoad(K...)
?enableReturnOfDeletedEntities
(boolean enabled) Deprecated, for removal: This API element is subject to removal in a future version.ShouldmultiLoad(K...)
return entity instances that have been marked for removal in the current session, but not yet deleted in the database?enableSessionCheck
(boolean enabled) Deprecated, for removal: This API element is subject to removal in a future version.Specifies whether the ids of managed entity instances already cached in the current persistence context should be excluded from the list of ids sent to the database.Deprecated, for removal: This API element is subject to removal in a future version.Retrieve the entities with the given identifiers.multiLoad
(K... ids) Deprecated, for removal: This API element is subject to removal in a future version.Retrieve the entities with the given identifiers.default MultiIdentifierLoadAccess
<T> with
(EntityGraph<T> graph) Deprecated.with
(EntityGraph<T> graph, GraphSemantic semantic) Deprecated, for removal: This API element is subject to removal in a future version.Customize the associations fetched by specifying an entity graph, and how it should be interpreted.Deprecated, for removal: This API element is subject to removal in a future version.Specify the timeout to use when querying the database.Deprecated, for removal: This API element is subject to removal in a future version.Specify theCacheMode
to use when obtaining an entity.default MultiIdentifierLoadAccess
<T> Deprecated, for removal: This API element is subject to removal in a future version.Specify the lock mode to use when querying the database.with
(LockMode lockMode, PessimisticLockScope lockScope) Deprecated, for removal: This API element is subject to removal in a future version.Specify the lock mode to use when querying the database.with
(LockOptions lockOptions) Deprecated, for removal: This API element is subject to removal in a future version.withBatchSize
(int batchSize) Deprecated, for removal: This API element is subject to removal in a future version.Specify a batch size, that is, how many entities should be fetched in each request to the database.default MultiIdentifierLoadAccess
<T> withFetchGraph
(EntityGraph<T> graph) Deprecated, for removal: This API element is subject to removal in a future version.Override the associations fetched by default by specifying the complete list of associations to be fetched as an entity graph.default MultiIdentifierLoadAccess
<T> withLoadGraph
(EntityGraph<T> graph) Deprecated, for removal: This API element is subject to removal in a future version.Augment the associations fetched by default by specifying a list of additional associations to be fetched as an entity graph.withReadOnly
(boolean readOnly) Deprecated, for removal: This API element is subject to removal in a future version.Specify whether the entities should be loaded in read-only mode.
-
Method Details
-
with
Deprecated, for removal: This API element is subject to removal in a future version.Specify the lock mode to use when querying the database.- Parameters:
lockMode
- The lock mode to apply- Returns:
this
, for method chaining
-
with
Deprecated, for removal: This API element is subject to removal in a future version.Specify the lock mode to use when querying the database.- Parameters:
lockMode
- The lock mode to apply- Returns:
this
, for method chaining
-
with
Deprecated, for removal: This API element is subject to removal in a future version.Specify the timeout to use when querying the database.- Parameters:
timeout
- The timeout to apply to the database operation- Returns:
this
, for method chaining
-
with
@Deprecated(since="7.0", forRemoval=true) MultiIdentifierLoadAccess<T> with(LockOptions lockOptions) Deprecated, for removal: This API element is subject to removal in a future version.Specify the lock options to use when querying the database.- Parameters:
lockOptions
- The lock options to use- Returns:
this
, for method chaining
-
with
Deprecated, for removal: This API element is subject to removal in a future version.Specify theCacheMode
to use when obtaining an entity.- Parameters:
cacheMode
- TheCacheMode
to use- Returns:
this
, for method chaining
-
withReadOnly
Deprecated, for removal: This API element is subject to removal in a future version.Specify whether the entities should be loaded in read-only mode.- Since:
- 7.0
- See Also:
-
withFetchGraph
Deprecated, for removal: This API element is subject to removal in a future version.Override the associations fetched by default by specifying the complete list of associations to be fetched as an entity graph.- Since:
- 6.3
-
withLoadGraph
Deprecated, for removal: This API element is subject to removal in a future version.Augment the associations fetched by default by specifying a list of additional associations to be fetched as an entity graph.- Since:
- 6.3
-
with
Deprecated. -
with
Deprecated, for removal: This API element is subject to removal in a future version.Customize the associations fetched by specifying an entity graph, and how it should be interpreted. -
enableFetchProfile
Deprecated, for removal: This API element is subject to removal in a future version.Customize the associations fetched by specifying a fetch profile that should be enabled during this operation.This allows the session-level fetch profiles to be temporarily overridden.
- Since:
- 7.0
-
disableFetchProfile
Deprecated, for removal: This API element is subject to removal in a future version.Customize the associations fetched by specifying a fetch profile that should be disabled during this operation.This allows the session-level fetch profiles to be temporarily overridden.
- Since:
- 7.0
-
withBatchSize
Deprecated, for removal: This API element is subject to removal in a future version.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.
The performance impact of setting a batch size depends on whether a SQL array may be used to pass the list of identifiers to the database:
- for databases which support standard SQL arrays, a smaller batch size might be extremely inefficient compared to a very large batch size or no batching at all, but
- on the other hand, for databases with no SQL array type, a large batch size results in long SQL statements with many JDBC parameters.
A batch size is considered a hint.
- Parameters:
batchSize
- The batch size- Returns:
this
, for method chaining
-
enableSessionCheck
Deprecated, for removal: This API element is subject to removal in a future version.Specifies whether the ids of managed entity instances already cached in the current persistence context should be excluded from the list of ids sent to the database.By default, all ids are included and sent to the database.
- Parameters:
enabled
-true
if they should be excluded;false
if they should be included.- Returns:
this
, for method chaining
-
enableReturnOfDeletedEntities
Deprecated, for removal: This API element is subject to removal in a future version.ShouldmultiLoad(K...)
return entity instances that have been marked for removal in 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
enableOrderedReturn(boolean)
is used.- Parameters:
enabled
-true
if removed entities should be returned;false
if they should be replaced by null values.- Returns:
this
, for method chaining
-
enableOrderedReturn
Deprecated, for removal: This API element is subject to removal in a future version.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 tomultiLoad(K...)
?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.
- Parameters:
enabled
-true
if entity instances should be ordered;false
if they may be returned in any order.- Returns:
this
, for method chaining
-
multiLoad
Deprecated, for removal: This API element is subject to removal in a future version.Retrieve the entities with the given identifiers.Note that the options
enableReturnOfDeletedEntities(boolean)
andenableOrderedReturn(boolean)
affect the size and shape of the returned list of entity instances.- Type Parameters:
K
- The identifier type- Parameters:
ids
- The ids to load- Returns:
- The persistent entities.
-
multiLoad
Deprecated, for removal: This API element is subject to removal in a future version.Retrieve the entities with the given identifiers.Note that the options
enableReturnOfDeletedEntities(boolean)
andenableOrderedReturn(boolean)
affect the size and shape of the returned list of entity instances.- Type Parameters:
K
- The identifier type- Parameters:
ids
- The ids to load- Returns:
- The persistent entities.
-