Interface EntityRepository<T extends EntityInterface>
- Type Parameters:
T- the type of entity that extends AbstractEntity
- All Known Implementing Classes:
KokosObjectRepository
public interface EntityRepository<T extends EntityInterface>
The interface of generic repository for entities. It defines the basic CRUD operations.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteById(EntityRepositoryContext context, String id) Deletes an entity by its id.find(EntityRepositoryContext context) Reads a list of entitiesfindById(EntityRepositoryContext context, String id) Reads a single entity by its id.save(EntityRepositoryContext context, T entity) Creates a new entity and returns the created entity with its generated id.updateById(EntityRepositoryContext context, String id, T entity) Updates an existing entity and returns the updated entity.
-
Method Details
-
find
Reads a list of entities- Throws:
RepositoryException
-
findById
Reads a single entity by its id.- Throws:
RepositoryException
-
save
Creates a new entity and returns the created entity with its generated id.- Throws:
RepositoryException
-
deleteById
Deletes an entity by its id.- Throws:
RepositoryException
-
updateById
Updates an existing entity and returns the updated entity.- Throws:
RepositoryException
-