org.nuiton.wikitty.search
Class Search

java.lang.Object
  extended by org.nuiton.wikitty.search.Search
Direct Known Subclasses:
SubSearch

Deprecated. since 3.3 use new query api WikittyQuery

@Deprecated
public class Search
extends Object

Helper to create a criteria with restrictions. To create a search, use Search.query() and add restrictions to that query. In the end, create the criteria from the query and use it on find methods. Element : * .[.] : search on an extension and field with specific type (optional) * Criteria.ALL_EXTENSIONS.. : search on all extension and field name with specific type 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
          Deprecated. Default operator type between all search condition.
 
Field Summary
protected  Search.KIND kind
          Deprecated. Defaut kind to Search.KIND.AND.
protected  List<Restriction> restrictions
          Deprecated.  
protected  List<Search> subSearchs
          Deprecated.  
 
Constructor Summary
Search()
          Deprecated.  
 
Method Summary
 Search and()
          Deprecated. And (sub query).
 Search associated(String foreignFieldName)
          Deprecated. Add SubSearch to allow search on association (like sql join)
 Search bw(String element, String lowerValue, String upperValue)
          Deprecated. Between.
 Search contains(String element, Collection<String> values)
          Deprecated. Contains.
 Search contains(String element, String value1, String... values)
          Deprecated. Contains.
 Criteria criteria()
          Deprecated. Return unnamed criteria.
 Criteria criteria(String name)
          Deprecated. Return named criteria.
protected static Element elt(String element)
          Deprecated.  
 Search eq(String element, Collection<String> values)
          Deprecated. 
 Search eq(String element, String value)
          Deprecated. Equals.
 Search ew(String element, String value)
          Deprecated. Ends with.
 Search exteq(Collection<String> values)
          Deprecated. Extension equals.
 Search exteq(String value)
          Deprecated. Extension equals.
 Search extneq(String value)
          Deprecated. Extension not equals.
 Search ge(String element, String value)
          Deprecated. Greater than or equals.
protected  Restriction getRestrictions()
          Deprecated.  
 Search gt(String element, String value)
          Deprecated. Greater than.
 Search ideq(String value)
          Deprecated. Id equals.
 Search idneq(String value)
          Deprecated. Id not equals.
 Search in(String element, Collection<String> values)
          Deprecated. In.
 Search in(String element, String value1, String... values)
          Deprecated. In.
 Search isNotNull(String fieldName)
          Deprecated. Is not null.
 Search isNull(String fieldName)
          Deprecated. Is null.
 Search keyword(String value)
          Deprecated. Keyword.
 Search le(String element, String value)
          Deprecated. Less than or equals.
 Search like(String element, String value)
          Deprecated.  
 Search like(String element, String value, Like.SearchAs searchAs)
          Deprecated. Like.
 Search lt(String element, String value)
          Deprecated. Less than.
 Search neq(String element, String value)
          Deprecated. Not equals.
 Search not()
          Deprecated. Not (sub query).
 Search notew(String element, String value)
          Deprecated. Not ends with.
 Search nsw(String element, String value)
          Deprecated. Not starts with.
 Search or()
          Deprecated. Or (sub query).
static Search query()
          Deprecated. Create new Search object with default kind to Search.KIND.AND.
static Search query(Criteria criteria)
          Deprecated. Create a new query on an existing criteria to add new constraints to the existing criteria.
static Search query(Search.KIND kind)
          Deprecated. Create new Search object with custom kind.
static Search query(Wikitty wikitty)
          Deprecated. Create Search query with field in wikitty argument.
 Search rFalse()
          Deprecated. False.
 Search rTrue()
          Deprecated. True.
 Search sw(String element, String value)
          Deprecated. Starts with.
 Search unlike(String element, String value)
          Deprecated.  
 Search unlike(String element, String value, Like.SearchAs searchAs)
          Deprecated. Unlike.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kind

protected Search.KIND kind
Deprecated. 
Defaut kind to Search.KIND.AND.


restrictions

protected List<Restriction> restrictions
Deprecated. 

subSearchs

protected List<Search> subSearchs
Deprecated. 
Constructor Detail

Search

public Search()
Deprecated. 
Method Detail

query

public static Search query(Wikitty wikitty)
Deprecated. 
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()
Deprecated. 
Create new Search object with default kind to Search.KIND.AND.

Returns:
Search helper

query

public static Search query(Search.KIND kind)
Deprecated. 
Create new Search object with custom kind.

Parameters:
kind - kind
Returns:
Search helper

query

public static Search query(Criteria criteria)
Deprecated. 
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)
Deprecated. 

contains

public Search contains(String element,
                       Collection<String> values)
Deprecated. 
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 put
values - the values to search in the element
Returns:
this with the contains restriction added.

contains

public Search contains(String element,
                       String value1,
                       String... values)
Deprecated. 
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 put
value1 - first value to search in the field
values - list of values to search in the field
Returns:
this with the contains restriction added.

in

public Search in(String element,
                 Collection<String> values)
Deprecated. 
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 put
values - 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)
Deprecated. 
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 put
value1 - first value the field must be in
values - list of values the field must be in
Returns:
this with the in restriction added.

eq

public Search eq(String element,
                 String value)
Deprecated. 
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 made
value - the value the element must be equals to
Returns:
this

exteq

public Search exteq(String value)
Deprecated. 
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)
Deprecated. 
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

@Deprecated
public Search eq(String element,
                            Collection<String> values)
Deprecated. 

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 put
values - list of values that the element must be equals to
Returns:
this with the ideq restriction added.

exteq

public Search exteq(Collection<String> values)
Deprecated. 
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)
Deprecated. 
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 put
value - the value the element must not be equals to.
Returns:
this with the neq restriction added.

extneq

public Search extneq(String value)
Deprecated. 
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)
Deprecated. 
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)
Deprecated. 
Greater than. Search if an element value is greater than the parameter.

Parameters:
element - the element on which the restriction is put
value - the value to be compared to
Returns:
this with the gt restriction added.

ge

public Search ge(String element,
                 String value)
Deprecated. 
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 made
value - the value to be compared to
Returns:
this with the ge restriction added.

lt

public Search lt(String element,
                 String value)
Deprecated. 
Less than. Search if an element value is less than the parameter.

Parameters:
element - the element on which the restriction is put
value - the value to be compared to
Returns:
this with the lt restriction added.

le

public Search le(String element,
                 String value)
Deprecated. 
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)
Deprecated. 
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)
Deprecated. 
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)
Deprecated. 
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)
Deprecated. 
Ends with. Search if an element ends with the value in parameter.

Parameters:
element - the element on which the restriction is put
value - the value the element must ends with.
Returns:
this with the ew restriction added.

notew

public Search notew(String element,
                    String value)
Deprecated. 
Not ends with. Search if an element does not ends with the value in parameter.

Parameters:
element - the element on which the restriction is put
value - the value the element must not ends with.
Returns:
this with the notew restriction added.

keyword

public Search keyword(String value)
Deprecated. 
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)
Deprecated. 
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)
Deprecated. 
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()
Deprecated. 
False. Add a restriction that always return false.

Returns:
this with the rFalse restriction added.

rTrue

public Search rTrue()
Deprecated. 
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)
Deprecated. 
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 put
value -
searchAs -
Returns:
this

like

public Search like(String element,
                   String value)
Deprecated. 

unlike

public Search unlike(String element,
                     String value,
                     Like.SearchAs searchAs)
Deprecated. 
Unlike.

Parameters:
element - the element on which the restriction is put
value -
searchAs -
Returns:
this

unlike

public Search unlike(String element,
                     String value)
Deprecated. 

not

public Search not()
Deprecated. 
Not (sub query).

Returns:
sub query

or

public Search or()
Deprecated. 
Or (sub query).

Returns:
sub query

and

public Search and()
Deprecated. 
And (sub query).

Returns:
sub query

associated

public Search associated(String foreignFieldName)
Deprecated. 
Add SubSearch to allow search on association (like sql join)

Parameters:
foreignFieldName - association fieldName
Returns:
sub query

criteria

public Criteria criteria(String name)
Deprecated. 
Return named criteria.

Parameters:
name - name of criteria
Returns:
new criteria

criteria

public Criteria criteria()
Deprecated. 
Return unnamed criteria.

Returns:
new criteria

getRestrictions

protected Restriction getRestrictions()
                               throws UnsupportedOperationException
Deprecated. 
Throws:
UnsupportedOperationException


Copyright © 2009-2012 CodeLutin. All Rights Reserved.