Interface PojoLoadingPlan<T>
- Type Parameters:
T- The exposed type of loaded entities.
- All Known Implementing Classes:
PojoMultiLoaderLoadingPlan
public interface PojoLoadingPlan<T>
A mutable plan to load POJO entities from an external source (database, ...).
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()static <T> PojoLoadingPlan<T>create(PojoSelectionLoadingContext context, Collection<? extends PojoLoadingTypeContext<? extends T>> targetTypes) voidloadBlocking(Deadline deadline) Loads the entities whose identifiers were passed toplanLoading(PojoLoadingTypeContext, Object), blocking the current thread while doing so.<T2 extends T>
intplanLoading(PojoLoadingTypeContext<T2> expectedType, Object identifier) Plans the loading of an entity instance.<T2 extends T>
T2retrieve(PojoLoadingTypeContext<T2> expectedType, int ordinal) Retrieves a loaded entity instance.
-
Method Details
-
create
static <T> PojoLoadingPlan<T> create(PojoSelectionLoadingContext context, Collection<? extends PojoLoadingTypeContext<? extends T>> targetTypes) -
planLoading
Plans the loading of an entity instance.- Type Parameters:
T2- The exact expected type for the entity instance.- Parameters:
expectedType- The exact expected type for the entity instance.identifier- The entity identifier.- Returns:
- An ordinal to pass later to
retrieve(PojoLoadingTypeContext, int). - See Also:
-
loadBlocking
Loads the entities whose identifiers were passed toplanLoading(PojoLoadingTypeContext, Object), blocking the current thread while doing so.- Parameters:
deadline- The deadline for loading the entities, or null if there is no deadline.
-
retrieve
Retrieves a loaded entity instance.- Type Parameters:
T2- The exact expected type for the entity instance.- Parameters:
expectedType- The expected type for the entity instance. Must be the same type passed toplanLoading(PojoLoadingTypeContext, Object).ordinal- The ordinal returned byplanLoading(PojoLoadingTypeContext, Object).- Returns:
- The loaded entity instance, or
nullif it was not found. The instance is guaranteed to be an instance of the given type exactly (not a subtype).
-
clear
void clear()
-