T
- type of domain objectpublic class GenericSearchBuilder<T extends Searchable>
extends java.lang.Object
It is preferable to use server side specification.
Constructor and Description |
---|
GenericSearchBuilder(java.lang.Class<T> manifest,
ServiceLocator locator)
Create new instance of generic search builder by providing
domain object type and locator
|
Modifier and Type | Method and Description |
---|---|
GenericSearchBuilder<T> |
ascending(java.lang.String property)
Order results ascending by specified property.
|
GenericSearchBuilder<T> |
descending(java.lang.String property)
Order results descending by specified property.
|
GenericSearchBuilder<T> |
doesntStartsWith(java.lang.String property,
java.lang.String value)
Define !startsWith [ not property.startsWith(value) ] condition for specification.
|
GenericSearchBuilder<T> |
doesntStartsWith(java.lang.String property,
java.lang.String value,
boolean ignoreCase)
Define !startsWith and case sensitivity [ not property.startsWith(value, case sensitivity) ] condition for specification.
|
GenericSearchBuilder<T> |
equal(java.lang.String property,
java.lang.Object value)
Define equal (=) condition for specification.
|
GenericSearchBuilder<T> |
greaterThen(java.lang.String property,
java.lang.Object value)
Define greater then (>) condition for specification.
|
GenericSearchBuilder<T> |
greaterThenOrEqual(java.lang.String property,
java.lang.Object value)
Define greater then or equal (>=) condition for specification.
|
GenericSearchBuilder<T> |
in(java.lang.String property,
java.lang.Object value)
Define in ( value in collection property ) condition for specification.
|
GenericSearchBuilder<T> |
inValue(java.lang.String property,
java.lang.Object value)
Define in [ property in collection value ] condition for specification.
|
GenericSearchBuilder<T> |
lessThen(java.lang.String property,
java.lang.Object value)
Define less then (<) condition for specification.
|
GenericSearchBuilder<T> |
lessThenOrEqual(java.lang.String property,
java.lang.Object value)
Define less then or equal (<=) condition for specification.
|
GenericSearchBuilder<T> |
limit(int limit)
Limit the number of results which will be performed.
|
GenericSearchBuilder<T> |
nonEqual(java.lang.String property,
java.lang.Object value)
Define not equal (!=) condition for specification.
|
GenericSearchBuilder<T> |
notIn(java.lang.String property,
java.lang.Object value)
Define not in ( not value in collection property ) condition for specification.
|
GenericSearchBuilder<T> |
notInValue(java.lang.String property,
java.lang.Object value)
Define in [ not property in collection value ] condition for specification.
|
GenericSearchBuilder<T> |
offset(int offset)
Skip initial number of results.
|
java.util.concurrent.Future<java.util.List<T>> |
search()
Ask server to provide domain objects which satisfy defined conditions
in requested order if custom order was provided.
|
GenericSearchBuilder<T> |
skip(int offset)
Skip initial number of results.
|
GenericSearchBuilder<T> |
startsWith(java.lang.String property,
java.lang.String value)
Define startsWith [ property.startsWith(value) ] condition for specification.
|
GenericSearchBuilder<T> |
startsWith(java.lang.String property,
java.lang.String value,
boolean ignoreCase)
Define startsWith and case sensitivity [ property.startsWith(value, case sensitivity) ] condition for specification.
|
GenericSearchBuilder<T> |
take(int limit)
Limit the number of results which will be performed.
|
GenericSearchBuilder<T> |
valueDoesntStartsWith(java.lang.String property,
java.lang.String value)
Define !startsWith [ not value.startsWith(property) ] condition for specification.
|
GenericSearchBuilder<T> |
valueDoesntStartsWith(java.lang.String property,
java.lang.String value,
boolean ignoreCase)
Define !startsWith and case sensitivity [ not value.startsWith(property, case sensitivity) ] condition for specification.
|
GenericSearchBuilder<T> |
valueStartsWith(java.lang.String property,
java.lang.String value)
Define startsWith [ value.startsWith(property) ] condition for specification.
|
GenericSearchBuilder<T> |
valueStartsWith(java.lang.String property,
java.lang.String value,
boolean ignoreCase)
Define startsWith and case sensitivity [ value.startsWith(property, case sensitivity) ] condition for specification.
|
public GenericSearchBuilder(java.lang.Class<T> manifest, ServiceLocator locator)
manifest
- domain object typelocator
- service locator with registered servicespublic GenericSearchBuilder<T> take(int limit)
limit
- maximum number of resultspublic GenericSearchBuilder<T> limit(int limit)
limit
- maximum number of resultspublic GenericSearchBuilder<T> skip(int offset)
offset
- number of skipped resultspublic GenericSearchBuilder<T> offset(int offset)
offset
- number of skipped resultspublic java.util.concurrent.Future<java.util.List<T>> search()
public GenericSearchBuilder<T> ascending(java.lang.String property)
property
- name of propertypublic GenericSearchBuilder<T> descending(java.lang.String property)
property
- name of propertypublic GenericSearchBuilder<T> equal(java.lang.String property, java.lang.Object value) throws java.io.IOException
property
- name of property to comparevalue
- check equality with provided valuejava.io.IOException
public GenericSearchBuilder<T> nonEqual(java.lang.String property, java.lang.Object value) throws java.io.IOException
property
- name of property to comparevalue
- check equality with provided valuejava.io.IOException
public GenericSearchBuilder<T> lessThen(java.lang.String property, java.lang.Object value) throws java.io.IOException
property
- name of property to comparevalue
- check ordering with provided valuejava.io.IOException
public GenericSearchBuilder<T> lessThenOrEqual(java.lang.String property, java.lang.Object value) throws java.io.IOException
property
- name of property to comparevalue
- check ordering and equality with provided valuejava.io.IOException
public GenericSearchBuilder<T> greaterThen(java.lang.String property, java.lang.Object value) throws java.io.IOException
property
- name of property to comparevalue
- check ordering with provided valuejava.io.IOException
public GenericSearchBuilder<T> greaterThenOrEqual(java.lang.String property, java.lang.Object value) throws java.io.IOException
property
- name of property to comparevalue
- check ordering and equality with provided valuejava.io.IOException
public GenericSearchBuilder<T> in(java.lang.String property, java.lang.Object value) throws java.io.IOException
property
- name of property to checkvalue
- check collection for provided valuejava.io.IOException
public GenericSearchBuilder<T> notIn(java.lang.String property, java.lang.Object value) throws java.io.IOException
property
- name of property to checkvalue
- check collection for provided valuejava.io.IOException
public GenericSearchBuilder<T> inValue(java.lang.String property, java.lang.Object value) throws java.io.IOException
property
- name of collection property to checkvalue
- check if property is in provided collection valuejava.io.IOException
public GenericSearchBuilder<T> notInValue(java.lang.String property, java.lang.Object value) throws java.io.IOException
property
- name of collection property to checkvalue
- check if property is not in provided collection valuejava.io.IOException
public GenericSearchBuilder<T> startsWith(java.lang.String property, java.lang.String value) throws java.io.IOException
property
- name of property to checkvalue
- comparison valuejava.io.IOException
public GenericSearchBuilder<T> startsWith(java.lang.String property, java.lang.String value, boolean ignoreCase) throws java.io.IOException
property
- name of property to checkvalue
- comparison valueignoreCase
- should string comparison ignore casingjava.io.IOException
public GenericSearchBuilder<T> doesntStartsWith(java.lang.String property, java.lang.String value) throws java.io.IOException
property
- name of property to checkvalue
- comparison valuejava.io.IOException
public GenericSearchBuilder<T> doesntStartsWith(java.lang.String property, java.lang.String value, boolean ignoreCase) throws java.io.IOException
property
- name of property to checkvalue
- comparison valueignoreCase
- should string comparison ignore casingjava.io.IOException
public GenericSearchBuilder<T> valueStartsWith(java.lang.String property, java.lang.String value) throws java.io.IOException
property
- name of property to checkvalue
- comparison valuejava.io.IOException
public GenericSearchBuilder<T> valueStartsWith(java.lang.String property, java.lang.String value, boolean ignoreCase) throws java.io.IOException
property
- name of property to checkvalue
- comparison valueignoreCase
- should string comparison ignore casingjava.io.IOException
public GenericSearchBuilder<T> valueDoesntStartsWith(java.lang.String property, java.lang.String value) throws java.io.IOException
property
- name of property to checkvalue
- comparison valuejava.io.IOException
public GenericSearchBuilder<T> valueDoesntStartsWith(java.lang.String property, java.lang.String value, boolean ignoreCase) throws java.io.IOException
property
- name of property to checkvalue
- comparison valueignoreCase
- should string comparison ignore casingjava.io.IOException