public abstract class AbstractSimpleRepository<T,ID extends java.io.Serializable> extends java.lang.Object implements ResourceRepository<T,ID>
Constructor and Description |
---|
AbstractSimpleRepository() |
Modifier and Type | Method and Description |
---|---|
void |
delete(ID id)
Removes a document identified by id legacy.
|
java.lang.Iterable<T> |
findAll(java.lang.Iterable<ID> ids,
QueryParams queryParams)
Search for resources constrained by a list of identifiers.
|
java.lang.Iterable<T> |
findAll(QueryParams queryParams)
Search for all of the resources.
|
T |
findOne(ID id) |
T |
findOne(ID id,
QueryParams queryParams)
Search one document with a given ID.
|
<S extends T> |
save(S entity)
Saves a document.
|
public T findOne(ID id, QueryParams queryParams)
ResourceRepository
ResourceNotFoundException
exception should be thrown.findOne
in interface ResourceRepository<T,ID extends java.io.Serializable>
id
- an identifier of the documentqueryParams
- parameters sent along with the requestpublic java.lang.Iterable<T> findAll(QueryParams queryParams)
ResourceRepository
QueryParams
can be used if necessary. If no
resources can be found, an empty Iterable
or null must be returned.findAll
in interface ResourceRepository<T,ID extends java.io.Serializable>
queryParams
- parameters send with the requestpublic java.lang.Iterable<T> findAll(java.lang.Iterable<ID> ids, QueryParams queryParams)
ResourceRepository
QueryParams
can be used if
necessary. If no resources can be found, an empty Iterable
or null must be returned.findAll
in interface ResourceRepository<T,ID extends java.io.Serializable>
ids
- an Iterable
of passed document identifiersqueryParams
- parameters send with the requestpublic <S extends T> S save(S entity)
ResourceRepository
save
in interface ResourceRepository<T,ID extends java.io.Serializable>
S
- type of the documententity
- document to be savedpublic void delete(ID id)
ResourceRepository
delete
in interface ResourceRepository<T,ID extends java.io.Serializable>
id
- identified of the document to be removed