Interface EntityHandler


public interface EntityHandler
Globals Handler to access MasterEntities
Since:
10.0.16
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends MasterEntity>
    T
    get(Class<T> masterEntityClass, Long id)
    Returns the instance of the MasterEntity with the matching id.
    <T extends MasterEntity>
    T
    get(Class<T> masterEntityClass, Predicate<T> p)
    Returns the instance of the MasterEntity with the matching predicate.
    <T extends MasterEntity>
    List<T>
    get(Class<T> masterEntityClass, Predicate<T> p, Comparator<? super T> sortComparator)
    Returns a list of the instances of the MasterEntities with the matching predicate, or all, if no predicate is provided.
    default <T extends MasterEntity>
    List<T>
    getEntities(Class<T> masterEntityClass)
    Returns a list of the not deleted instances of the MasterEntities.
  • Method Details

    • get

      <T extends MasterEntity> T get(Class<T> masterEntityClass, Long id)
      Returns the instance of the MasterEntity with the matching id.
      Type Parameters:
      T - the type of the master entity
      Parameters:
      masterEntityClass - the interface representing the MasterEntity
      id - the id of the entity to be returned
      Returns:
      the entity
      Since:
      10.0.16
    • get

      <T extends MasterEntity> T get(Class<T> masterEntityClass, Predicate<T> p)
      Returns the instance of the MasterEntity with the matching predicate.
      Type Parameters:
      T - the type of the master entity
      Parameters:
      masterEntityClass - the interface representing the MasterEntity.
      p - the predicate to match
      Returns:
      the entity
      Since:
      10.0.16
    • get

      <T extends MasterEntity> List<T> get(Class<T> masterEntityClass, Predicate<T> p, Comparator<? super T> sortComparator)
      Returns a list of the instances of the MasterEntities with the matching predicate, or all, if no predicate is provided.
      Type Parameters:
      T - the type of the master entity
      Parameters:
      masterEntityClass - the interface representing the MasterEntity.
      p - the predicate to match
      sortComparator - the comparator for sorting
      Returns:
      the list of matching entities
      Since:
      10.0.16
    • getEntities

      default <T extends MasterEntity> List<T> getEntities(Class<T> masterEntityClass)
      Returns a list of the not deleted instances of the MasterEntities.
      Type Parameters:
      T - the type of the master entity
      Parameters:
      masterEntityClass - the interface representing the MasterEntity.
      Returns:
      the list of matching, not deleted entities
      Since:
      10.0.108