Package org.gbif.api.service.common
Interface CrudService<T,W,K>
-
- Type Parameters:
T- The complete entity classW- The writable entity class, can be the same as TK- The primary key class of the entity
public interface CrudService<T,W,K>
A generic CRUD service interface for any writable entity.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Kcreate(W entity)Persists a new entity.voiddelete(K key)Deletes the entity.Tget(K key)Get an entity by its unique key.PagingResponse<T>list(Pageable page)Lists all entity.voidupdate(W entity)Updates the entity.
-
-
-
Method Detail
-
create
K create(W entity)
Persists a new entity.- Parameters:
entity- to create.- Returns:
- The persisted entity.
-
get
@Nullable T get(K key)
Get an entity by its unique key.- Returns:
- the entity or null if not existing.
-
list
PagingResponse<T> list(@Nullable Pageable page)
Lists all entity.- Parameters:
page- to enable paging.- Returns:
- The pagable list of entities.
-
-