public static class FluentLoader.ById<E>
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
ById(FluentLoader<E> loader,
java.lang.Object id) |
Modifier and Type | Method and Description |
---|---|
FluentLoader.ById<E> |
accessConstraints(java.lang.Class<? extends AccessConstraint> accessConstraintsClass)
Adds registered access constraints that are subclasses of the given class.
|
FluentLoader.ById<E> |
accessConstraints(java.util.Collection<AccessConstraint<?>> accessConstraints)
Adds access constraints.
|
FluentLoader.ById<E> |
fetchPlan(java.util.function.Consumer<FetchPlanBuilder> fetchPlanBuilderConfigurer)
Configure the fetch plan.
|
FluentLoader.ById<E> |
fetchPlan(FetchPlan fetchPlan)
Sets a fetch plan.
|
FluentLoader.ById<E> |
fetchPlan(java.lang.String fetchPlanName)
Sets a fetch plan by name.
|
FluentLoader.ById<E> |
fetchPlanProperties(java.lang.String... properties)
Sets a fetch plan containing the given properties.
|
FluentLoader.ById<E> |
hint(java.lang.String hintName,
java.io.Serializable value)
Adds a custom hint that should be used by the query.
|
FluentLoader.ById<E> |
hints(java.util.Map<java.lang.String,java.io.Serializable> hints)
Adds custom hints that should be used by the query.
|
FluentLoader.ById<E> |
joinTransaction(boolean join)
Indicates that the operation must be performed in an existing transaction if it exists.
|
E |
one()
Loads a single instance.
|
java.util.Optional<E> |
optional()
Loads a single instance and wraps it in Optional.
|
protected ById(FluentLoader<E> loader, java.lang.Object id)
public java.util.Optional<E> optional()
public E one()
java.lang.IllegalStateException
- if nothing was loadedpublic FluentLoader.ById<E> fetchPlan(@Nullable FetchPlan fetchPlan)
public FluentLoader.ById<E> fetchPlan(@Nullable java.lang.String fetchPlanName)
public FluentLoader.ById<E> fetchPlan(java.util.function.Consumer<FetchPlanBuilder> fetchPlanBuilderConfigurer)
public FluentLoader.ById<E> fetchPlanProperties(java.lang.String... properties)
dataManager.load(Pet.class) .id(petId) .fetchPlanProperties( "name", "owner.name", "owner.address.city") .list();
public FluentLoader.ById<E> hint(java.lang.String hintName, java.io.Serializable value)
public FluentLoader.ById<E> hints(java.util.Map<java.lang.String,java.io.Serializable> hints)
public FluentLoader.ById<E> accessConstraints(java.util.Collection<AccessConstraint<?>> accessConstraints)
public FluentLoader.ById<E> accessConstraints(java.lang.Class<? extends AccessConstraint> accessConstraintsClass)
public FluentLoader.ById<E> joinTransaction(boolean join)