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:
Java usage:module Todo { sql TaskInfo 'SELECT name, description FROM task' { string name; string description; } }
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)
SearchableRepository
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.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)
SearchableRepository
specification
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)
SearchableRepository
specification
search
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)
SearchableRepository
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.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)
SearchableRepository
limit
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()
SearchableRepository
findAll
in interface SearchableRepository<T extends Searchable>
public java.util.concurrent.Future<java.lang.Long> count(Specification<T> specification)
SearchableRepository
count
in interface SearchableRepository<T extends Searchable>
specification
- search predicatepublic java.util.concurrent.Future<java.lang.Long> countAll()
SearchableRepository
countAll
in interface SearchableRepository<T extends Searchable>
public SearchBuilder<T> builder()
SearchableRepository
search builder
for this repository.
Search builder is helper class with fluent API for building search.builder
in interface SearchableRepository<T extends Searchable>