Interface CrudService<T,​W,​K>

  • Type Parameters:
    T - The complete entity class
    W - The writable entity class, can be the same as T
    K - The primary key class of the entity

    public interface CrudService<T,​W,​K>
    A generic CRUD service interface for any writable entity.
    • Method Detail

      • create

        K create​(W entity)
        Persists a new entity.
        Parameters:
        entity - to create.
        Returns:
        The persisted entity.
      • delete

        void delete​(K key)
        Deletes the entity.
        Parameters:
        key - The entity key to delete.
      • get

        @Nullable
        T get​(K key)
        Get an entity by its unique key.
        Returns:
        the entity or null if not existing.
      • list

        PagingResponse<Tlist​(@Nullable
                               Pageable page)
        Lists all entity.
        Parameters:
        page - to enable paging.
        Returns:
        The pagable list of entities.
      • update

        void update​(W entity)
        Updates the entity.
        Parameters:
        entity - to update