T - domain object typepublic abstract class ClientSearchableRepository<T extends Searchable> extends java.lang.Object implements SearchableRepository<T>
searchable repository.
It redirects calls to proxy services.
It shouldn't be used or resolved.
Instead domain model repositories should be resolved.
DSL example:
module Todo {
sql TaskInfo 'SELECT name, description FROM task' {
string name;
string description;
}
}
Java usage:
ServiceLocator locator; SearchableRepository<Todo.TaskInfo> repository = locator.resolve(Todo.TaskInfoRepository.class);
| Constructor and Description |
|---|
ClientSearchableRepository(java.lang.Class<T> manifest,
ServiceLocator locator)
Generated class will provide class manifest and locator
|
| 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. |
public ClientSearchableRepository(java.lang.Class<T> manifest, ServiceLocator locator)
manifest - domain object typelocator - context in which domain object livespublic 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)
SearchableRepositoryspecification
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.search in interface SearchableRepository<T extends Searchable>specification - search predicatelimit - maximum number of resultsoffset - number of results to be skippedorder - custom orderingpublic java.util.concurrent.Future<java.util.List<T>> search(Specification<T> specification, java.lang.Integer limit, java.lang.Integer offset)
SearchableRepositoryspecification
with up to limit results.
offset can be used to skip initial results.search in interface SearchableRepository<T extends Searchable>specification - search predicatelimit - maximum number of resultsoffset - number of results to be skippedpublic java.util.concurrent.Future<java.util.List<T>> search(Specification<T> specification)
SearchableRepositoryspecificationsearch in interface SearchableRepository<T extends Searchable>specification - search predicatepublic 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)
SearchableRepositorylimit 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.findAll in interface SearchableRepository<T extends Searchable>limit - maximum number of resultsoffset - number of results to be skippedorder - custom orderingpublic java.util.concurrent.Future<java.util.List<T>> findAll(java.lang.Integer limit, java.lang.Integer offset)
SearchableRepositorylimit results.
offset can be used to skip initial results.findAll in interface SearchableRepository<T extends Searchable>limit - maximum number of resultsoffset - number of results to be skippedpublic java.util.concurrent.Future<java.util.List<T>> findAll()
SearchableRepositoryfindAll in interface SearchableRepository<T extends Searchable>public java.util.concurrent.Future<java.lang.Long> count(Specification<T> specification)
SearchableRepositorycount in interface SearchableRepository<T extends Searchable>specification - search predicatepublic java.util.concurrent.Future<java.lang.Long> countAll()
SearchableRepositorycountAll in interface SearchableRepository<T extends Searchable>public SearchBuilder<T> builder()
SearchableRepositorysearch builder for this repository.
Search builder is helper class with fluent API for building search.builder in interface SearchableRepository<T extends Searchable>