Package com.helixframework.db.repository
Interface CursorPagedRepository<T,K,C>
- Type Parameters:
T- the type of entityK- the type of keyC- the type of the cursor
public interface CursorPagedRepository<T,K,C>
Represents a repository that allows cursor-based pagination for querying and manipulating entities.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclear()Deletes all entities from the repository.Finds an entity by its key.default CursorPagedResult<T>query(CursorQuerySpecification<T, C> spec) Executes a query based on the given query specification.default CursorPagedResult<T>query(MappingCursorQuerySpecification<T, C> spec) Executes a query based on the given query specification.default intremove(UpdateSpecification spec) Removes entities from the repository according to the specifications provided.default voidRemoves an entity from the repository.default intupdate(UpdateSpecification spec) Updates entities in the repository based on the provided update specification.default TUpdates an entity in the repository.
-
Method Details
-
query
Executes a query based on the given query specification.- Parameters:
spec- the query specification to execute- Returns:
- a result containing the entities that match the query and cursor pagination information
-
query
Executes a query based on the given query specification.- Parameters:
spec- the query specification to execute- Returns:
- a result containing the entities that match the query and cursor pagination information
-
find
Finds an entity by its key.- Parameters:
key- the key of the entity- Returns:
- an Optional containing the entity if found, or an empty Optional if not found
-
update
Updates an entity in the repository.- Parameters:
entity- the entity to be updated- Returns:
- the updated entity
-
update
Updates entities in the repository based on the provided update specification.- Parameters:
spec- the update specification defining the update criteria and data- Returns:
- the number of rows affected by the update operation
-
remove
Removes an entity from the repository.- Parameters:
entity- the entity to be removes
-
remove
Removes entities from the repository according to the specifications provided.- Parameters:
spec- the update specification defining the criteria for entity removal- Returns:
- the number of rows affected by the remove operation
-
clear
default void clear()Deletes all entities from the repository.
-