specify search on field as NUMERIC, STRING, WIKITTY, BOOLEAN, DATE. Use Element.ElementType to specify type.
Some patterns might be available depending on the restriction used. They are :
* '*' replace any number of characters
* '?' replace one character
|
Nested Class Summary |
static class |
Search.KIND
Default operator type between all search condition. |
|
Method Summary |
Search |
and()
And (sub query). |
Search |
associated(String foreignFieldName)
|
Search |
bw(String element,
String lowerValue,
String upperValue)
Between. |
Search |
contains(String element,
Collection<String> values)
Contains. |
Search |
contains(String element,
String value1,
String... values)
Contains. |
Criteria |
criteria()
Return unnamed criteria. |
Criteria |
criteria(String name)
Return named criteria. |
protected static Element |
elt(String element)
|
Search |
eq(String element,
Collection<String> values)
Equals. |
Search |
eq(String element,
String value)
Equals. |
Search |
ew(String element,
String value)
Ends with. |
Search |
exteq(Collection<String> values)
Extension equals. |
Search |
exteq(String value)
Extension equals. |
Search |
extneq(String value)
Extension not equals. |
Search |
ge(String element,
String value)
Greater than or equals. |
protected Restriction |
getRestrictions()
|
Search |
gt(String element,
String value)
Greater than. |
Search |
ideq(String value)
Id equals. |
Search |
idneq(String value)
Id not equals. |
Search |
in(String element,
Collection<String> values)
In. |
Search |
in(String element,
String value1,
String... values)
In. |
Search |
isNotNull(String fieldName)
Is not null. |
Search |
isNull(String fieldName)
Is null. |
Search |
keyword(String value)
Keyword. |
Search |
le(String element,
String value)
Less than or equals. |
Search |
like(String element,
String value)
|
Search |
like(String element,
String value,
Like.SearchAs searchAs)
Like. |
Search |
lt(String element,
String value)
Less than. |
Search |
neq(String element,
String value)
Not equals. |
Search |
not()
Not (sub query). |
Search |
notew(String element,
String value)
Not ends with. |
Search |
nsw(String element,
String value)
Not starts with. |
Search |
or()
Or (sub query). |
static Search |
query()
Create new Search object with default kind to Search.KIND.AND. |
static Search |
query(Criteria criteria)
Create a new query on an existing criteria to add new constraints to
the existing criteria. |
static Search |
query(Search.KIND kind)
Create new Search object with custom kind. |
static Search |
query(Wikitty wikitty)
Create Search query with field in wikitty argument. |
Search |
rFalse()
False. |
Search |
rTrue()
True. |
Search |
sw(String element,
String value)
Starts with. |
Search |
unlike(String element,
String value)
|
Search |
unlike(String element,
String value,
Like.SearchAs searchAs)
Unlike. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
kind
protected Search.KIND kind
- Defaut kind to
Search.KIND.AND.
restrictions
protected List<Restriction> restrictions
subSearchs
protected List<Search> subSearchs
Search
public Search()
query
public static Search query(Wikitty wikitty)
- Create Search query with field in wikitty argument.
Null field are not used in search request.
- Parameters:
wikitty - example use to create query
- Returns:
- query
query
public static Search query()
- Create new
Search object with default kind to Search.KIND.AND.
- Returns:
- Search helper
query
public static Search query(Search.KIND kind)
- Create new
Search object with custom kind.
- Parameters:
kind - kind
- Returns:
- Search helper
query
public static Search query(Criteria criteria)
- Create a new query on an existing criteria to add new constraints to
the existing criteria.
- Parameters:
criteria - the existing criteria
- Returns:
- a new query to add constraints to the criteria.
elt
protected static Element elt(String element)
contains
public Search contains(String element,
Collection<String> values)
- Contains.
Search on lists (multivalued fields) that a field contains all the values
of the list given in parameter.
Ex : The field with value [toto,titi,tutu] contains [titi,tutu] but not
[titi,tutu,tata]
Ps : Use wildcards if you search for substrings.
- Parameters:
element - the element on which the restriction is putvalues - the values to search in the element
- Returns:
this with the contains restriction added.
contains
public Search contains(String element,
String value1,
String... values)
- Contains.
Search on lists (multivalued fields) that a field contains all the values
given in parameter.
Ex : The field with value [toto,titi,tutu] contains [titi,tutu] but not
[titi,tutu,tata]
Ps : Use wildcards if you search for substrings.
- Parameters:
element - the element on which the restriction is putvalue1 - first value to search in the fieldvalues - list of values to search in the field
- Returns:
this with the contains restriction added.
in
public Search in(String element,
Collection<String> values)
- In.
Search if a field is contained in the list of values in parameter
Ex : The field with value titi is in [titi,tutu] but not in
[tutu,tata]
Ps : Use wildcards in the values if you search for substrings.
- Parameters:
element - the element on which the restriction is putvalues - list of values the field must be in
- Returns:
this with the in restriction added.
in
public Search in(String element,
String value1,
String... values)
- In.
Search if a field is contained in the list of values in parameter
Ex : The field with value titi is in [titi,tutu] but not in
[tutu,tata]
Ps : Use wildcards in the values if you search for substrings.
- Parameters:
element - the element on which the restriction is putvalue1 - first value the field must be invalues - list of values the field must be in
- Returns:
this with the in restriction added.
eq
public Search eq(String element,
String value)
- Equals.
Restrict search so that the field value equals the parameter.
You might use patterns in your equality.
- Parameters:
element - the field on which the search is madevalue - the value the element must be equals to
- Returns:
this
exteq
public Search exteq(String value)
- Extension equals.
Restrict search to wikitties that got the extension in parameter.
- Parameters:
value - the extension to restrict the results to
- Returns:
this with the exteq restriction added.
ideq
public Search ideq(String value)
- Id equals.
Restrict search to wikitties that got the id in parameter.
- Parameters:
value - the id to restrict the results to
- Returns:
this with the ideq restriction added.
eq
public Search eq(String element,
Collection<String> values)
- Equals.
Restrict search so that the field value equals all the members of the
list in parameters.
- Parameters:
element - the element on which the restriction is putvalues - list of values that the element must be equals to
- Returns:
this with the ideq restriction added.
exteq
public Search exteq(Collection<String> values)
- Extension equals.
Restrict search to wikitties that got all the extensions in parameter.
- Parameters:
values - list of the extension to restrict the results to
- Returns:
this with the exteq restriction added.
neq
public Search neq(String element,
String value)
- Not equals.
Restrict search to elements that are not equals to the value given in
parameter.
- Parameters:
element - the element on which the restriction is putvalue - the value the element must not be equals to.
- Returns:
this with the neq restriction added.
extneq
public Search extneq(String value)
- Extension not equals.
Restrict search to wikitties that do not get the extension given in
parameter.
- Parameters:
value - the extension that the wikitties must not have.
- Returns:
this with the extneq restriction added.
idneq
public Search idneq(String value)
- Id not equals.
Restrict search to wikitties that do not have the id given in parameter.
- Parameters:
value - the id the wikitties must not have.
- Returns:
this with the idneq restriction added.
gt
public Search gt(String element,
String value)
- Greater than.
Search if an element value is greater than the parameter.
- Parameters:
element - the element on which the restriction is putvalue - the value to be compared to
- Returns:
this with the gt restriction added.
ge
public Search ge(String element,
String value)
- Greater than or equals.
Search if an element value is greater than or equals to the parameter.
- Parameters:
element - the field on which the search is madevalue - the value to be compared to
- Returns:
this with the ge restriction added.
lt
public Search lt(String element,
String value)
- Less than.
Search if an element value is less than the parameter.
- Parameters:
element - the element on which the restriction is putvalue - the value to be compared to
- Returns:
this with the lt restriction added.
le
public Search le(String element,
String value)
- Less than or equals.
Search if an element value is less than or equals to the parameter.
- Parameters:
element - the element on which the restriction is put.value - the value to be compared to.
- Returns:
this with the le restriction added.
bw
public Search bw(String element,
String lowerValue,
String upperValue)
- Between.
Restrict search so that the element value is between the lower and upper
values (it can also be equals).
- Parameters:
element - the element on which the restriction is put.lowerValue - the lower bound.upperValue - the upper bound.
- Returns:
this with the le restriction added.
sw
public Search sw(String element,
String value)
- Starts with.
Search if an element starts with the value in parameter.
- Parameters:
element - the element on which the restriction is put.value - the value the element must start with.
- Returns:
this with the sw restriction added.
nsw
public Search nsw(String element,
String value)
- Not starts with.
Search if an element does not starts with the value in parameter.
- Parameters:
element - the element on which the restriction is put.value - the value the element must not start with.
- Returns:
this with the nsw restriction added.
ew
public Search ew(String element,
String value)
- Ends with.
Search if an element ends with the value in parameter.
- Parameters:
element - the element on which the restriction is putvalue - the value the element must ends with.
- Returns:
this with the ew restriction added.
notew
public Search notew(String element,
String value)
- Not ends with.
Search if an element does not ends with the value in parameter.
- Parameters:
element - the element on which the restriction is putvalue - the value the element must not ends with.
- Returns:
this with the notew restriction added.
keyword
public Search keyword(String value)
- Keyword.
Search if the value in parameter is present in any field of any
extension.
- Parameters:
value - the value to find.
- Returns:
this with the keyword restriction added.
isNull
public Search isNull(String fieldName)
- Is null.
Check that a field is null.
- Parameters:
fieldName - the field that must be null.
- Returns:
this with the isNull restriction added.
isNotNull
public Search isNotNull(String fieldName)
- Is not null.
Check that a field is not null.
- Parameters:
fieldName - the field that must not be null.
- Returns:
this with the isNotNull restriction added.
rFalse
public Search rFalse()
- False.
Add a restriction that always return false.
- Returns:
this with the rFalse restriction added.
rTrue
public Search rTrue()
- True.
Add a restriction that always return true.
- Returns:
this with the rTrue restriction added.
like
public Search like(String element,
String value,
Like.SearchAs searchAs)
- Like.
Check that a string is present in a field. For example "tric" is present
in "Restriction".
- Parameters:
element - the element on which the restriction is putvalue - searchAs -
- Returns:
this
like
public Search like(String element,
String value)
unlike
public Search unlike(String element,
String value,
Like.SearchAs searchAs)
- Unlike.
- Parameters:
element - the element on which the restriction is putvalue - searchAs -
- Returns:
this
unlike
public Search unlike(String element,
String value)
not
public Search not()
- Not (sub query).
- Returns:
- sub query
or
public Search or()
- Or (sub query).
- Returns:
- sub query
and
public Search and()
- And (sub query).
- Returns:
- sub query
associated
public Search associated(String foreignFieldName)
- Parameters:
foreignFieldName -
- Returns:
criteria
public Criteria criteria(String name)
- Return named criteria.
- Parameters:
name - name of criteria
- Returns:
- new criteria
criteria
public Criteria criteria()
- Return unnamed criteria.
- Returns:
- new criteria
getRestrictions
protected Restriction getRestrictions()
throws UnsupportedOperationException
- Throws:
UnsupportedOperationException
Copyright © 2009-2011 CodeLutin. All Rights Reserved.