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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()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 Detail
-
create
static <T> PojoLoadingPlan<T> create(PojoSelectionLoadingContext context, Collection<? extends PojoLoadingTypeContext<? extends T>> targetTypes)
-
planLoading
<T2 extends T> int planLoading(PojoLoadingTypeContext<T2> expectedType, Object identifier)
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(Deadline)
-
loadBlocking
void loadBlocking(Deadline deadline)
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
<T2 extends T> T2 retrieve(PojoLoadingTypeContext<T2> expectedType, int ordinal)
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()
-
-