ojb.broker.query
Class OJBSearchFilter

java.lang.Object
  |
  +--ojb.broker.query.SearchFilter
        |
        +--ojb.broker.query.OJBSearchFilter

public class OJBSearchFilter
extends SearchFilter

OJB Search Filter Class for ObJectRelationalBridge O/R mapping tool This class builds a search filter tree, specifing how names and values are to be compared when searching a database. This extends SearchFilter and implements the Convert method that produces the search filter string for the SQL database

Version:
$Revision: 1.1.1.1 $ $Date: 2002/02/15 06:25:27 $
Author:
koenig

Nested Class Summary
 
Nested classes inherited from class ojb.broker.query.SearchFilter
SearchFilter.SearchBase, SearchFilter.SearchBaseLeaf, SearchFilter.SearchBaseLeafComparison, SearchFilter.SearchBaseLeafInt, SearchFilter.SearchBaseNode
 
Field Summary
(package private)  Criteria criteria
           
 
Fields inherited from class ojb.broker.query.SearchFilter
AND, BINARY_OPER_MASK, EQUAL, filter, GREATER_EQUAL, GREATER_THAN, IN, LESS_EQUAL, LESS_THAN, LIKE, LOGICAL_OPER_MASK, NOT, NOT_EQUAL, NOT_IN, OR
 
Constructor Summary
OJBSearchFilter()
           
 
Method Summary
 void combine(SearchFilter new_filter, int op)
          Combine one other search filters with this one, using the specific operator.
 void combine(java.util.Vector new_filters, int op)
          Combine other search filters with this one, using the specific operator.
 void compareFilter(java.lang.String elementName, java.lang.String value, int oper)
          Change the search filter to one that compares an element name to a value.
protected  Criteria getCriteria()
          -----------------------------------------------------------
 void matchList(java.lang.String elementName, int[] values, int oper)
          Change the search filter to one that specifies an element to not match one of a list of integer values.
 void matchList(java.lang.String elementName, java.lang.String[] values, int oper)
          Change the search filter to one that specifies an element to not match one of a list of values.
 void matchList(java.lang.String elementName, java.util.Vector values, int oper)
          Change the search filter to one that specifies an element to match or not match one of a list of values.
 void matchSet(java.util.Hashtable elements, int combine_op, int compare_op)
          Change the search filter to one that specifies a set of elements and their values that must match, and the operator to use to combine the elements.
 void matchSet(java.lang.String[] elementNames, java.lang.String[] elementValues, int op)
          Change the search filter to one that specifies a set of elements and their values that must match, and the operator to use to combine the elements.
 void matchValue(java.lang.String elementName, int value, int oper)
          -----------------------------------------------------------
 void matchValue(java.lang.String elementName, java.lang.String value, int oper)
          Change the search filter to one that specifies an element to not match one single value.
 java.lang.String toString()
          -----------------------------------------------------------
 
Methods inherited from class ojb.broker.query.SearchFilter
ConvertBinaryOperator, getFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

criteria

Criteria criteria
Constructor Detail

OJBSearchFilter

public OJBSearchFilter()
Method Detail

matchList

public void matchList(java.lang.String elementName,
                      java.util.Vector values,
                      int oper)
Change the search filter to one that specifies an element to match or not match one of a list of values. The old search filter is deleted.

Overrides:
matchList in class SearchFilter
Parameters:
values - is a vector of possible matches
oper - is the IN or NOT_IN operator to indicate how to matche
elementName - is the name of the element to be matched

matchList

public void matchList(java.lang.String elementName,
                      java.lang.String[] values,
                      int oper)
Change the search filter to one that specifies an element to not match one of a list of values. The old search filter is deleted.

Overrides:
matchList in class SearchFilter
Parameters:
values - is an array of possible matches
oper - is the IN or NOT_IN operator to indicate how to matche
elementName - is the name of the element to be matched

matchList

public void matchList(java.lang.String elementName,
                      int[] values,
                      int oper)
Change the search filter to one that specifies an element to not match one of a list of integer values. The old search filter is deleted.

Overrides:
matchList in class SearchFilter
Parameters:
values - is an array of possible integer matches
oper - is the IN or NOT_IN operator to indicate how to matche
elementName - is the name of the element to be matched

matchValue

public void matchValue(java.lang.String elementName,
                       java.lang.String value,
                       int oper)
Change the search filter to one that specifies an element to not match one single value. The old search filter is deleted.

Overrides:
matchValue in class SearchFilter
Parameters:
value - is the value to not be matched
oper - is the IN or NOT_IN operator to indicate how to matche
elementName - is the name of the element to be matched

matchValue

public void matchValue(java.lang.String elementName,
                       int value,
                       int oper)
-----------------------------------------------------------

Overrides:
matchValue in class SearchFilter
Parameters:
value -
oper -
elementName -

compareFilter

public void compareFilter(java.lang.String elementName,
                          java.lang.String value,
                          int oper)
                   throws DBException
Change the search filter to one that compares an element name to a value. The old search filter is deleted.

Overrides:
compareFilter in class SearchFilter
Parameters:
value - is the value to be compared against
oper - is the binary comparison operator to be used
elementName - is the name of the element to be tested
Throws:
gov.lanl.Database.DBException
DBException

matchSet

public void matchSet(java.util.Hashtable elements,
                     int combine_op,
                     int compare_op)
              throws DBException
Change the search filter to one that specifies a set of elements and their values that must match, and the operator to use to combine the elements. Each key is compared for an equal match to the value, and all comparisons are combined by the specified logical operator (OR or AND). The old search filter is deleted.

Overrides:
matchSet in class SearchFilter
Parameters:
combine_op - is the logical operator to be used to combine the comparisons
compare_op - is the binary operator to be used for the comparisons
Throws:
gov.lanl.Utilty.DBException
DBException

matchSet

public void matchSet(java.lang.String[] elementNames,
                     java.lang.String[] elementValues,
                     int op)
              throws DBException
Change the search filter to one that specifies a set of elements and their values that must match, and the operator to use to combine the elements. Each element name is compared for an equal match to the value, and all comparisons are combined by the specified logical operator (OR or AND). The old search filter is deleted.

Overrides:
matchSet in class SearchFilter
Parameters:
elementNames - is an array of names of elements to be tested
elementValues - is an array of values for the corresponding element
Throws:
gov.lanl.Database.DBException
DBException

combine

public void combine(java.util.Vector new_filters,
                    int op)
             throws DBException
Combine other search filters with this one, using the specific operator.

Overrides:
combine in class SearchFilter
Parameters:
new_filters - is a vector of SearchFilter classes to be combined
op - is the logical operator to be used to combine the filters
Throws:
gov.lanl.Database.DBException
DBException

combine

public void combine(SearchFilter new_filter,
                    int op)
             throws DBException
Combine one other search filters with this one, using the specific operator.

Overrides:
combine in class SearchFilter
Parameters:
new_filter - is the SearchFilter class to be combined
op - is the logical operator to be used to combine the filters
Throws:
gov.lanl.Database.DBException
DBException

toString

public java.lang.String toString()
-----------------------------------------------------------

Specified by:
toString in class SearchFilter
Returns:

getCriteria

protected Criteria getCriteria()
-----------------------------------------------------------

Returns:


Authors: Thomas Mahler and others. (C) 2000, 2001.
All rights reserved. Published under the Gnu Public License.
http://objectbridge.sourceforge.net
Version: 0.8.375, 2002-04-04