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.default UpdateStrategyReturns the repository default update strategy.default Set<UpdateStrategy> Returns the update strategies supported by this repository.default UpdateStrategyResolves the effective update strategy using context metadata and repository defaults.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
-
getDefaultUpdateStrategy
Returns the repository default update strategy. -
getSupportedUpdateStrategies
Returns the update strategies supported by this repository. -
resolveUpdateStrategy
default UpdateStrategy resolveUpdateStrategy(EntityRepositoryContext context) throws RepositoryException Resolves the effective update strategy using context metadata and repository defaults.- Throws:
RepositoryException
-
getSupportedCapabilities
Set<EntityRepositoryCapability> getSupportedCapabilities()
-