Class LazyEntityList

All Implemented Interfaces:
EntityList, Iterable<Entity>

public class LazyEntityList extends AbstractLazyEntityList
An implementation of EntityList that delays initialization until the entities are actually accessed. The entities are loaded in pages of size 50 (per default).
  • Constructor Details

  • Method Details

    • get

      public Entity get(int index, boolean eager) throws PersistException
      Description copied from interface: EntityList
      Get the entity at the specified index.
      Parameters:
      index - The index.
      eager - true, if a page should be eagerly loaded, if the entity's state is hollow, false otherwise.
      Returns:
      The entity at the specified index potentially in unusable state, or null.
      Throws:
      PersistException
    • getManager

      public EntityManager getManager()
      Description copied from interface: EntityList
      Get the entity manager.
      Returns:
      The entity manager.
    • getFirstEntity

      public Entity getFirstEntity()
      Returns:
      the first entity or null