net.smartlab.web
Class DataAccessObject.SearchInfo

java.lang.Object
  extended by net.smartlab.web.DataAccessObject.SearchInfo
All Implemented Interfaces:
java.io.Serializable
Enclosing interface:
DataAccessObject

public static class DataAccessObject.SearchInfo
extends java.lang.Object
implements java.io.Serializable

Instances of this class represents a set of criterias to be used in persistence tier searches. This class is providen as a support class used to define search criterias using request parameters and should not be used in place of Hibernate's Criteria or Query as it doesn't provide the same customizability or features.

Author:
rlogiacco
See Also:
Serialized Form

Nested Class Summary
protected  class DataAccessObject.SearchInfo.Filter
          Represents a filtering condition to be applied while performing searches.
 
Field Summary
static int BETWEEN
          Identifies a between expression condition.
static int EQUALS
          Identifies a greater expression condition.
static int GREATER
          Identifies an equals expression condition.
static int GREATER_EQUALS
          Identifies a greater expression condition.
static int ILIKE
          Identifies an ilike expression condition.
static int IN
          Identifies an in expression condition.
static int LESSER
          Identifies a greater equals expression condition.
static int LESSER_EQUALS
          Identifies a lesser expression condition.
static int LIKE
          Identifies a like expression condition.
static int NOT_EQUALS
          Identifies a lesser equal expression condition.
static int NOT_IN
          Identifies a not in expression condition.
static int NOT_NULL
          Identifies an is not null expression condition.
static int NULL
          Identifies an is null expression condition.
 
Constructor Summary
DataAccessObject.SearchInfo()
           
 
Method Summary
 void addFilter(java.lang.String filter)
          Adds a filter.
 void addFilter(java.lang.String property, int condition, java.lang.Object value)
          Adds a filter.
 void addFilter(java.lang.String property, int condition, java.lang.Object[] values)
          Adds a filter.
 void addFilter(java.lang.String property, int condition, java.lang.String values)
          Adds a filter.
 void addFilter(java.lang.String property, int condition, java.lang.String[] values)
          Adds a filter.
 java.util.Collection getFilters()
           
 java.util.Locale getLocale()
          Returns the locale used to convert filters.
 java.lang.String getOrder()
           
 boolean isDescendant()
           
 boolean isUnion()
          TODO documentation
 void setFilters(java.util.Collection filters)
           
 void setFilters(java.lang.String[] filters)
           
 void setLocale(java.util.Locale locale)
          Sets the locale used to convert filters.
 void setOrder(java.lang.String order)
          Sets the property used to order the collection.
 void setUnion(boolean union)
          TODO documentation
 void setUnion(java.lang.String style)
          TODO documentation
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EQUALS

public static final int EQUALS
Identifies a greater expression condition.

See Also:
Constant Field Values

GREATER

public static final int GREATER
Identifies an equals expression condition.

See Also:
Constant Field Values

GREATER_EQUALS

public static final int GREATER_EQUALS
Identifies a greater expression condition.

See Also:
Constant Field Values

LESSER

public static final int LESSER
Identifies a greater equals expression condition.

See Also:
Constant Field Values

LESSER_EQUALS

public static final int LESSER_EQUALS
Identifies a lesser expression condition.

See Also:
Constant Field Values

NOT_EQUALS

public static final int NOT_EQUALS
Identifies a lesser equal expression condition.

See Also:
Constant Field Values

LIKE

public static final int LIKE
Identifies a like expression condition.

See Also:
Constant Field Values

ILIKE

public static final int ILIKE
Identifies an ilike expression condition.

See Also:
Constant Field Values

BETWEEN

public static final int BETWEEN
Identifies a between expression condition.

See Also:
Constant Field Values

NULL

public static final int NULL
Identifies an is null expression condition.

See Also:
Constant Field Values

NOT_NULL

public static final int NOT_NULL
Identifies an is not null expression condition.

See Also:
Constant Field Values

IN

public static final int IN
Identifies an in expression condition.

See Also:
Constant Field Values

NOT_IN

public static final int NOT_IN
Identifies a not in expression condition.

See Also:
Constant Field Values
Constructor Detail

DataAccessObject.SearchInfo

public DataAccessObject.SearchInfo()
Method Detail

isDescendant

public boolean isDescendant()
Returns:
returns the ordering direction.

getFilters

public java.util.Collection getFilters()
Returns:
returns the filters.

setFilters

public void setFilters(java.util.Collection filters)
Parameters:
filters - the filters to set.

setFilters

public void setFilters(java.lang.String[] filters)
Parameters:
filters - the filters to set.

addFilter

public void addFilter(java.lang.String filter)
Adds a filter.

Parameters:
filter - the filter to add.

addFilter

public void addFilter(java.lang.String property,
                      int condition,
                      java.lang.String values)
Adds a filter.

Parameters:
property - the property to filter on.
condition - the expression condition to apply on the property.
values - a comma separated list of values to evaluate against the condition.

addFilter

public void addFilter(java.lang.String property,
                      int condition,
                      java.lang.Object value)
               throws ConversionException
Adds a filter.

Parameters:
property - the property to filter on.
condition - the expression condition to apply on the property.
value - a value to evaluate against the condition.
Throws:
ConversionException

addFilter

public void addFilter(java.lang.String property,
                      int condition,
                      java.lang.String[] values)
Adds a filter.

Parameters:
property - the property to filter on.
condition - the expression condition to apply on the property.
values - an array of values to evaluate against the condition.

addFilter

public void addFilter(java.lang.String property,
                      int condition,
                      java.lang.Object[] values)
               throws ConversionException
Adds a filter.

Parameters:
property - the property to filter on.
condition - the expression condition to apply on the property.
values - an array of values to evaluate against the condition.
Throws:
ConversionException

getOrder

public java.lang.String getOrder()
Returns:
returns the order.

setOrder

public void setOrder(java.lang.String order)
Sets the property used to order the collection. By default the ordering is set to descendant unless an ! (exclamation mark) is prefixed indicating an ascendant order must be used.

Parameters:
order - the property used to order the collection, optionally prefixed by ! (exclamation mark) to invert the sorting direction.

setUnion

public void setUnion(java.lang.String style)
TODO documentation

Parameters:
style -

setUnion

public void setUnion(boolean union)
TODO documentation

Since:
1.2.12

isUnion

public boolean isUnion()
TODO documentation

Returns:

setLocale

public void setLocale(java.util.Locale locale)
Sets the locale used to convert filters.

Parameters:
locale - the locale to set.

getLocale

public java.util.Locale getLocale()
Returns the locale used to convert filters.

Returns:
the locale used to convert filters.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2004-2009 The SmartWeb Team. All Rights Reserved.