public interface RepositoryOperations<T,ID extends Serializable>
PagingAndSortingRepository, but with some additions
to support dynamic queries, and removing some JPA-specific functionality.| Modifier and Type | Method and Description |
|---|---|
long |
count()
Returns a count of total records in the repository.
|
long |
count(Iterable<QueryCriteria> queryCriterias)
Returns a count of all records that satify the requested criteria.
|
void |
delete(ID id)
Deletes a record in the repository, identified by its
ID. |
void |
deleteAll()
Deletes every record in the repository.
|
Iterable<Object> |
distinct(String field)
Returns a unsorted list of distinct values of the requested field.
|
Iterable<Object> |
distinct(String field,
Iterable<QueryCriteria> queryCriterias)
Returns a unsorted list of distinct values of the requested field, filtered using a
QueryCriteria
based query. |
boolean |
exists(ID id)
Tests whether or not a record with the given
ID exists in the repository. |
Iterable<T> |
find(Iterable<QueryCriteria> queryCriterias)
Searches for all records that satisfy the requested criteria.
|
org.springframework.data.domain.Page<T> |
find(Iterable<QueryCriteria> queryCriterias,
org.springframework.data.domain.Pageable pageable)
Searches for all records that satisfy the requested criteria, and returns them as a paged
collection.
|
Iterable<T> |
find(Iterable<QueryCriteria> queryCriterias,
org.springframework.data.domain.Sort sort)
Searches for all records that satisfy the requested criteria, and returns them in the
requested order.
|
Iterable<T> |
findAll()
Retrieves all records from the repository.
|
org.springframework.data.domain.Page<T> |
findAll(org.springframework.data.domain.Pageable pageable)
Retrieves a paged representation of every records in the repository.
|
Iterable<T> |
findAll(org.springframework.data.domain.Sort sort)
Retrieves all records from the repository, sorted into the desired order.
|
T |
findOne(ID id)
Retrieves a single record by it's
ID. |
<S extends T> |
insert(Iterable<S> entities)
Creates multiple new records and returns their updated representations.
|
<S extends T> |
insert(S entity)
Creates a new record in the repository and returns the updated model object.
|
<S extends T> |
update(Iterable<S> entities)
Updates multiple records and returns their instances.
|
<S extends T> |
update(S entity)
Updates an existing record in the repository and returns its instance.
|
T findOne(ID id)
ID.id - ID value for the entity.T, or null if not found.boolean exists(ID id)
ID exists in the repository.id - ID value for the entity.true if the record exists, or false if it does not.Iterable<T> findAll()
T in the repository.Iterable<T> findAll(org.springframework.data.domain.Sort sort)
sort - SortT in the repository.org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable)
pageable - PageablePage containing the desired set of records.long count()
T records.Iterable<T> find(Iterable<QueryCriteria> queryCriterias)
queryCriterias - QueryCriteriaT records.Iterable<T> find(Iterable<QueryCriteria> queryCriterias, org.springframework.data.domain.Sort sort)
queryCriterias - QueryCriteriasort - SortT records.org.springframework.data.domain.Page<T> find(Iterable<QueryCriteria> queryCriterias, org.springframework.data.domain.Pageable pageable)
queryCriterias - QueryCriteriapageable - PageablePage containing the desired set of records.long count(Iterable<QueryCriteria> queryCriterias)
queryCriterias - QueryCriteriaT records.Iterable<Object> distinct(String field)
field - Model field name.field.Iterable<Object> distinct(String field, Iterable<QueryCriteria> queryCriterias)
QueryCriteria
based query.field - Model field name.queryCriterias - Query criteria to filter the field values by.field.<S extends T> S insert(S entity)
entity - instance of T to be persisted.<S extends T> Iterable<S> insert(Iterable<S> entities)
entities - collection of records to be persisted.<S extends T> S update(S entity)
entity - updated record to be persisted in the repository.<S extends T> Iterable<S> update(Iterable<S> entities)
entities - collection of records to update.void delete(ID id)
ID.id - identifier for the record to be deleted.void deleteAll()
Copyright © 2016. All rights reserved.