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 K
create(W entity)
Persists a new entity.void
delete(K key)
Deletes the entity.T
get(K key)
Get an entity by its unique key.PagingResponse<T>
list(Pageable page)
Lists all entity.void
update(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.
-
-