Interface IGenericMultiBoDao

  • All Known Implementing Classes:
    GenericMultiBoJdbcDao

    public interface IGenericMultiBoDao
    API interface for DAO that manages multi-BO classes.
    Since:
    0.9.0
    Author:
    Thanh Nguyen
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      <T> DaoResult create​(java.lang.Class<T> clazz, T bo)
      Create/Persist a new BO to storage.
      default <T> DaoResult createOrUpdate​(java.lang.Class<T> clazz, T bo)
      Create a new BO or update an existing one.
      <T> DaoResult delete​(java.lang.Class<T> clazz, T bo)
      Delete an existing BO from storage.
      <T> T get​(java.lang.Class<T> clazz, BoId id)
      Fetch an existing BO from storage by id.
      <T> T[] get​(java.lang.Class<T> clazz, BoId... idList)
      Fetch list of existing BOs from storage by id.
      <T> java.util.stream.Stream<T> getAll​(java.lang.Class<T> clazz)
      Fetch all existing BOs from storage and return the result as a stream.
      <T> java.util.stream.Stream<T> getAllSorted​(java.lang.Class<T> clazz)
      Fetch all existing BOs from storage, sorted by primary key(s) and return the result as a stream.
      <T> DaoResult update​(java.lang.Class<T> clazz, T bo)
      Update an existing BO.
      default <T> DaoResult updateOrCreate​(java.lang.Class<T> clazz, T bo)
      Update an existing BO or create a new one.
    • Method Detail

      • create

        <T> DaoResult create​(java.lang.Class<T> clazz,
                             T bo)
                      throws DaoException
        Create/Persist a new BO to storage.
        Parameters:
        clazz -
        bo -
        Returns:
        Throws:
        DaoException
      • delete

        <T> DaoResult delete​(java.lang.Class<T> clazz,
                             T bo)
                      throws DaoException
        Delete an existing BO from storage.
        Parameters:
        clazz -
        bo -
        Returns:
        Throws:
        DaoException
      • get

        <T> T get​(java.lang.Class<T> clazz,
                  BoId id)
           throws DaoException
        Fetch an existing BO from storage by id.
        Parameters:
        clazz -
        id -
        Returns:
        Throws:
        DaoException
      • get

        <T> T[] get​(java.lang.Class<T> clazz,
                    BoId... idList)
             throws DaoException
        Fetch list of existing BOs from storage by id.
        Parameters:
        idList -
        Returns:
        Throws:
        DaoException
      • getAll

        <T> java.util.stream.Stream<T> getAll​(java.lang.Class<T> clazz)
                                       throws DaoException
        Fetch all existing BOs from storage and return the result as a stream.
        Parameters:
        clazz -
        Returns:
        Throws:
        DaoException
      • getAllSorted

        <T> java.util.stream.Stream<T> getAllSorted​(java.lang.Class<T> clazz)
                                             throws DaoException
        Fetch all existing BOs from storage, sorted by primary key(s) and return the result as a stream.
        Parameters:
        clazz -
        Returns:
        Throws:
        DaoException
      • update

        <T> DaoResult update​(java.lang.Class<T> clazz,
                             T bo)
                      throws DaoException
        Update an existing BO.
        Parameters:
        clazz -
        bo -
        Returns:
        Throws:
        DaoException
      • createOrUpdate

        default <T> DaoResult createOrUpdate​(java.lang.Class<T> clazz,
                                             T bo)
                                      throws DaoException
        Create a new BO or update an existing one.
        Parameters:
        clazz -
        bo -
        Returns:
        Throws:
        DaoException
      • updateOrCreate

        default <T> DaoResult updateOrCreate​(java.lang.Class<T> clazz,
                                             T bo)
                                      throws DaoException
        Update an existing BO or create a new one.
        Parameters:
        clazz -
        bo -
        Returns:
        Throws:
        DaoException