var graph = session.createEntityGraph(Book.class);
graph.addSubgraph(Book_.publisher);
List<Book> books =
session.byMultipleIds(Book.class)
.withFetchGraph(graph)
.withBatchSize(20)
.multiLoad(bookIds);
Session#byMultipleIds(Class)
| Modifier and Type | Method and Description |
|---|---|
| public MultiIdentifierLoadAccess | Returns: this, for method chainingtrue if entity instances should be ordered;
false if they may be returned in any order.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 to |
| public MultiIdentifierLoadAccess | Returns: this, for method chainingtrue if removed entities should be returned;
false if they should be replaced by null values.Should |
| public MultiIdentifierLoadAccess | Returns: this, for method chainingtrue if they should be excluded;
false if they should be included.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. |
| public < The identifier type K> List | Returns: The persistent entities.The ids to load ids)Retrieve the entities with the given identifiers. |
| public < The identifier type K> List | |
| public MultiIdentifierLoadAccess | Returns: this, for method chainingThe lock options to use lockOptions)Specify the lock options to use when querying the database. |
| public MultiIdentifierLoadAccess | |
| public default MultiIdentifierLoadAccess | |
| public MultiIdentifierLoadAccess | with(RootGraph<T> graph, GraphSemantic semantic)
Customize the associations fetched by specifying an entity graph, and how it should be interpreted. |
| public MultiIdentifierLoadAccess | Returns: this, for method chainingThe batch size batchSize)Specify a batch size, that is, how many entities should be fetched in each request to the database. |
| public default MultiIdentifierLoadAccess | withFetchGraph(RootGraph<T> graph)
Override the associations fetched by default by specifying the complete list of associations to be fetched as an entity graph. |
| public default MultiIdentifierLoadAccess | withLoadGraph(RootGraph<T> graph)
Augment the associations fetched by default by specifying a list of additional associations to be fetched as an entity graph. |
| enableOrderedReturn | back to summary |
|---|---|
| public MultiIdentifierLoadAccess 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 to 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.
| |
| enableReturnOfDeletedEntities | back to summary |
|---|---|
| public MultiIdentifierLoadAccess Should
By default, instances marked for removal are replaced by null in
the returned list of entities when
| |
| enableSessionCheck | back to summary |
|---|---|
| public MultiIdentifierLoadAccess 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.
| |
| multiLoad | back to summary |
|---|---|
| public <K> List Retrieve the entities with the given identifiers.
Note that the options
| |
| multiLoad | back to summary |
|---|---|
| public <K> List Retrieve the entities with the given identifiers.
Note that the options | |
| with | back to summary |
|---|---|
| public MultiIdentifierLoadAccess Specify the lock options to use when querying the database.
| |
| with | back to summary |
|---|---|
| public MultiIdentifierLoadAccess Specify the
| |
| with | back to summary |
|---|---|
public default MultiIdentifierLoadAccess
| |
| with | back to summary |
|---|---|
| public MultiIdentifierLoadAccess Customize the associations fetched by specifying an entity graph, and how it should be interpreted. | |
| withBatchSize | back to summary |
|---|---|
| public MultiIdentifierLoadAccess Specify a batch size, that is, how many entities should be fetched in each request to the database.
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.
| |
| withFetchGraph | back to summary |
|---|---|
| public default MultiIdentifierLoadAccess Override the associations fetched by default by specifying the complete list of associations to be fetched as an entity graph. | |
| withLoadGraph | back to summary |
|---|---|
| public default MultiIdentifierLoadAccess Augment the associations fetched by default by specifying a list of additional associations to be fetched as an entity graph. | |