Interface PojoSelectionEntityLoader<E>

Type Parameters:
E - A supertype of the type of loaded entities.

public interface PojoSelectionEntityLoader<E>
A loader for loading a small selection of entities, used in particular during search.

Compared to PojoMassEntityLoader, this loader:

  • Receives batches of identifiers from the caller.
  • Is expected to load a small number of entities, potentially in a single batch.
  • Returns loaded entities as a list.
  • Relies on a pre-existing loading context (a session, a transaction, ...).
  • Must ensure entities remain usable (lazy-loading, ...) as long as the supporting context is active.
  • Method Summary

    Modifier and Type
    Method
    Description
    loadBlocking(List<?> identifiers, Deadline deadline)
    Loads the entities corresponding to the given identifiers, blocking the current thread while doing so.
  • Method Details

    • loadBlocking

      List<E> loadBlocking(List<?> identifiers, Deadline deadline)
      Loads the entities corresponding to the given identifiers, blocking the current thread while doing so.
      Parameters:
      identifiers - A list of identifiers for objects to load.
      deadline - The deadline for loading the entities, or null if there is no deadline. Should be complied with on a best-effort basis: it's acceptable to ignore it, but it means some timeouts in Hibernate Search will not work properly.
      Returns:
      A list of entities, in the same order the references were given. null is inserted when an object is not found or has an excluded types (see PojoSelectionLoadingStrategy.createEntityLoader(Set, PojoSelectionLoadingContext)).