Interface Dao<T>

Type Parameters:
T - the type of entity
All Known Subinterfaces:
InetnumLocationDao
All Known Implementing Classes:
InetnumLocationDaoSqliteImpl

public interface Dao<T>
A basic DAO interface to implement the data access object pattern
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(T t)
    Delete the given element
    Find all the elements
    findOne(long id)
    Find the element with the given id
    void
    save(T t)
    Save the given element
    void
    update(T t, String[] params)
    Update the given element
  • Method Details

    • findOne

      Optional<T> findOne(long id)
      Find the element with the given id
      Parameters:
      id - the id of the element to find
      Returns:
      the optional element
    • findAll

      List<T> findAll()
      Find all the elements
      Returns:
      the list of all the elements
    • save

      void save(T t)
      Save the given element
      Parameters:
      t - the element to save
    • update

      void update(T t, String[] params)
      Update the given element
      Parameters:
      t - the element to update
      params - the list of fields to update
    • delete

      void delete(T t)
      Delete the given element
      Parameters:
      t - the element to delete