Interface IGenericDAO<K,​E>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void create​(E entity)
      Create an entity
      void detach​(E entity)
      Remove the given entity from the persistence context, causing a managed entity to become detached.
      List<E> findAll()
      Find all entities
      E findById​(K key)
      Find an entity by its Id
      void flush()
      Synchronize the persistence context to the underlying database.
      void remove​(K key)
      Remove an entity
      void update​(E entity)
      Update an entity
    • Method Detail

      • create

        void create​(E entity)
        Create an entity
        Parameters:
        entity - The entity to create
      • update

        void update​(E entity)
        Update an entity
        Parameters:
        entity - An entity that contains new values
      • remove

        void remove​(K key)
        Remove an entity
        Parameters:
        key - The key of the entity to remove
      • findById

        E findById​(K key)
        Find an entity by its Id
        Parameters:
        key - The entity key
        Returns:
        The entity object
      • findAll

        List<E> findAll()
        Find all entities
        Returns:
        A list of entities
      • flush

        void flush()
        Synchronize the persistence context to the underlying database.
      • detach

        void detach​(E entity)
        Remove the given entity from the persistence context, causing a managed entity to become detached.
        Parameters:
        entity - the entity