Interface BaseService<T,​ID>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      long count()  
      void delete​(ID id)
      Deletes object with id ID from backstore, exception raised by failure.
      void delete​(java.util.List<T> instances)
      Deletes object with these IDs from backstore, exception raised by failure.
      boolean exists​(ID id)  
      <S extends T>
      S
      findOne​(ID id)
      Return a entity based on its ID.
      <S extends T>
      S
      save​(S instance)
      Store object T to backstore
    • Method Detail

      • count

        long count()
        Returns:
        number of entities
      • exists

        boolean exists​(ID id)
        Parameters:
        id - ID of entity
        Returns:
        true if exists
      • findOne

        <S extends T> S findOne​(ID id)
        Return a entity based on its ID.
        Parameters:
        id - ID of entity
        Returns:
        Entity
      • save

        <S extends T> S save​(S instance)
        Store object T to backstore
        Parameters:
        instance - object T
        Returns:
        saved instance T (may have fields updated by backstore)
      • delete

        void delete​(ID id)
             throws org.springframework.dao.DataAccessException
        Deletes object with id ID from backstore, exception raised by failure.
        Parameters:
        id - ID of entity
        Throws:
        org.springframework.dao.DataAccessException
      • delete

        void delete​(java.util.List<T> instances)
             throws org.springframework.dao.DataAccessException
        Deletes object with these IDs from backstore, exception raised by failure.
        Parameters:
        instances - list of entity IDs
        Throws:
        org.springframework.dao.DataAccessException