public interface MultiIdentifierLoadAccess<T>
multiLoad(K...)
methods, using the various options specified (if any)Modifier and Type | Method and Description |
---|---|
MultiIdentifierLoadAccess<T> |
enableOrderedReturn(boolean enabled)
Should the return List be ordered and positional in relation to the
incoming ids? If enabled (the default), the return List is ordered and
positional relative to the incoming ids.
|
MultiIdentifierLoadAccess<T> |
enableReturnOfDeletedEntities(boolean enabled)
Should the multi-load operation be allowed to return entities that are locally
deleted? A locally deleted entity is one which has been passed to this
Session's
Session.delete(java.lang.Object) / EntityManager.remove(java.lang.Object) method, but not
yet flushed. |
MultiIdentifierLoadAccess<T> |
enableSessionCheck(boolean enabled)
Specify whether we should check the Session to see whether it already contains any of the
entities to be loaded in a managed state for the purpose of not including those
ids to the batch-load SQL.
|
<K extends Serializable> |
multiLoad(K... ids)
Perform a load of multiple entities by identifiers.
|
<K extends Serializable> |
multiLoad(List<K> ids)
Perform a load of multiple entities by identifiers.
|
MultiIdentifierLoadAccess<T> |
with(CacheMode cacheMode)
Specify the
CacheMode to use when retrieving the entity. |
MultiIdentifierLoadAccess<T> |
with(LockOptions lockOptions)
Specify the
LockOptions to use when retrieving the entity. |
MultiIdentifierLoadAccess<T> |
withBatchSize(int batchSize)
Specify a batch size for loading the entities (how many at a time).
|
MultiIdentifierLoadAccess<T> with(LockOptions lockOptions)
LockOptions
to use when retrieving the entity.lockOptions
- The lock options to use.this
, for method chainingMultiIdentifierLoadAccess<T> with(CacheMode cacheMode)
CacheMode
to use when retrieving the entity.cacheMode
- The CacheMode to use.this
, for method chainingMultiIdentifierLoadAccess<T> withBatchSize(int batchSize)
batchSize
- The batch sizethis
, for method chainingMultiIdentifierLoadAccess<T> enableSessionCheck(boolean enabled)
enabled
- true
enables this checking; false
(the default) disables it.this
, for method chainingMultiIdentifierLoadAccess<T> enableReturnOfDeletedEntities(boolean enabled)
Session.delete(java.lang.Object)
/ EntityManager.remove(java.lang.Object)
method, but not
yet flushed. The default behavior is to handle them as null in the return
(see enableOrderedReturn(boolean)
).enabled
- true
enables returning the deleted entities;
false
(the default) disables it.this
, for method chainingMultiIdentifierLoadAccess<T> enableOrderedReturn(boolean enabled)
multiLoad([2,1,3])
will return [Entity#2, Entity#1, Entity#3]
.
An important distinction is made here in regards to the handling of
unknown entities depending on this "ordered return" setting. If enabled
a null is inserted into the List at the proper position(s). If disabled,
the nulls are not put into the return List. In other words, consumers of
the returned ordered List would need to be able to handle null elements.enabled
- true
(the default) enables ordering;
false
disables it.this
, for method chaining<K extends Serializable> List<T> multiLoad(K... ids)
enableOrderedReturn(boolean)
and enableReturnOfDeletedEntities(boolean)
for options which effect
the size and "shape" of the return list.K
- The identifier typeids
- The ids to load<K extends Serializable> List<T> multiLoad(List<K> ids)
enableOrderedReturn(boolean)
and enableReturnOfDeletedEntities(boolean)
for options which effect
the size and "shape" of the return list.K
- The identifier typeids
- The ids to loadCopyright © 2019 JBoss by Red Hat. All rights reserved.