T
- domain object type.public interface SearchableRepository<T extends Searchable>
specification
,
paged using limit and offset arguments.
Custom sort can be provided using list of property->direction pairs.
Specification can be declared in DSL or custom search can be built on client and sent to server.
When permissions are applied, server can restrict which results will be returned to the client. Service should be used when Future is a preferred way of interacting with the remote server.
Modifier and Type | Method and Description |
---|---|
SearchBuilder<T> |
builder()
Returns an instance of
search builder for this repository. |
java.util.concurrent.Future<java.lang.Long> |
count(Specification<T> specification)
Returns a number of elements satisfying provided specification.
|
java.util.concurrent.Future<java.lang.Long> |
countAll()
Returns a total number of domain objects.
|
java.util.concurrent.Future<java.util.List<T>> |
findAll()
Returns a list of all domain objects
|
java.util.concurrent.Future<java.util.List<T>> |
findAll(java.lang.Integer limit,
java.lang.Integer offset)
Returns a list of all domain objects
with up to
limit results. |
java.util.concurrent.Future<java.util.List<T>> |
findAll(java.lang.Integer limit,
java.lang.Integer offset,
java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> order)
Returns a list of all domain objects
with up to
limit results. |
java.util.concurrent.Future<java.util.List<T>> |
search(Specification<T> specification)
Returns a list of domain objects satisfying
specification |
java.util.concurrent.Future<java.util.List<T>> |
search(Specification<T> specification,
java.lang.Integer limit,
java.lang.Integer offset)
Returns a list of domain objects satisfying
specification
with up to limit results. |
java.util.concurrent.Future<java.util.List<T>> |
search(Specification<T> specification,
java.lang.Integer limit,
java.lang.Integer offset,
java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> order)
Returns a list of domain objects satisfying
specification
with up to limit results. |
java.util.concurrent.Future<java.util.List<T>> search(Specification<T> specification, java.lang.Integer limit, java.lang.Integer offset, java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> order)
specification
with up to limit
results.
offset
can be used to skip initial results.
order
should be given as a list of pairs of
<String, Boolean>
where first is a property name and second is whether it should be sorted
ascending over this property.specification
- search predicatelimit
- maximum number of resultsoffset
- number of results to be skippedorder
- custom orderingjava.util.concurrent.Future<java.util.List<T>> search(Specification<T> specification, java.lang.Integer limit, java.lang.Integer offset)
specification
with up to limit
results.
offset
can be used to skip initial results.specification
- search predicatelimit
- maximum number of resultsoffset
- number of results to be skippedjava.util.concurrent.Future<java.util.List<T>> search(Specification<T> specification)
specification
specification
- search predicatejava.util.concurrent.Future<java.util.List<T>> findAll(java.lang.Integer limit, java.lang.Integer offset, java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> order)
limit
results.
offset
can be used to skip initial results.
order
should be given as a list of pairs of
<String, Boolean>
where first is a property name and second is whether it should be sorted
ascending over this property.limit
- maximum number of resultsoffset
- number of results to be skippedorder
- custom orderingjava.util.concurrent.Future<java.util.List<T>> findAll(java.lang.Integer limit, java.lang.Integer offset)
limit
results.
offset
can be used to skip initial results.limit
- maximum number of resultsoffset
- number of results to be skippedjava.util.concurrent.Future<java.util.List<T>> findAll()
java.util.concurrent.Future<java.lang.Long> count(Specification<T> specification)
specification
- search predicatejava.util.concurrent.Future<java.lang.Long> countAll()
SearchBuilder<T> builder()
search builder
for this repository.
Search builder is helper class with fluent API for building search.