www.element4solution.com

e4s.db
Class E4DBFilterAnd

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.db.E4DBFilter
          extended by e4s.db.E4DBFilterAnd
All Implemented Interfaces:
E4DBFilter_Intf, E4DBFilterAnd_Intf
Direct Known Subclasses:
E4DBModifyCommon, E4DBSelect, T_E4S_CLIENT_Sel.T_E4S_CLIENT_And, T_E4S_CLIENT_VAL_Sel.T_E4S_CLIENT_VAL_And, T_E4S_COMPANY_GROUP_Sel.T_E4S_COMPANY_GROUP_And, T_E4S_COMPANY_Sel.T_E4S_COMPANY_And, T_E4S_COMPANY_USER_Sel.T_E4S_COMPANY_USER_And, T_E4S_FREEFIELD_DEF_Sel.T_E4S_FREEFIELD_DEF_And, T_E4S_FREEFIELD_VAL_Sel.T_E4S_FREEFIELD_VAL_And, T_E4S_HINT_READ_Sel.T_E4S_HINT_READ_And, T_E4S_HINT_Sel.T_E4S_HINT_And, T_E4S_LOGIN_HISTORY_Sel.T_E4S_LOGIN_HISTORY_And, T_E4S_MAIL_SENT_Sel.T_E4S_MAIL_SENT_And, T_E4S_OVERVIEW_Sel.T_E4S_OVERVIEW_And, T_E4S_PERMISSION_COMPANY_Sel.T_E4S_PERMISSION_COMPANY_And, T_E4S_PERMISSION_GROUP_Sel.T_E4S_PERMISSION_GROUP_And, T_E4S_PERMISSION_USER_Sel.T_E4S_PERMISSION_USER_And, T_E4S_QUERY_CLIENTS_Sel.T_E4S_QUERY_CLIENTS_And, T_E4S_QUERY_PARAMS_Sel.T_E4S_QUERY_PARAMS_And, T_E4S_QUERY_Sel.T_E4S_QUERY_And, T_E4S_TRANS_APP_Sel.T_E4S_TRANS_APP_And, T_E4S_TRANS_DATA_Sel.T_E4S_TRANS_DATA_And, T_E4S_TRANS_SYS_Sel.T_E4S_TRANS_SYS_And, T_E4S_USER_VAL_Sel.T_E4S_USER_VAL_And

public class E4DBFilterAnd
extends E4DBFilter
implements E4DBFilterAnd_Intf

Definition for an "anded" SQL-WHERE construct.

Since:
JDK 1.4
See Also:
E4DBFilter, E4DBFilterOr, E4DBFilter_Intf

Field Summary
 
Fields inherited from class e4s.db.E4DBFilter
COMP_EMPTY, COMP_EQUALS, COMP_GREATER, COMP_GREATER_EQUAL, COMP_IN, COMP_IS_NOT_NULL, COMP_IS_NULL, COMP_LESS, COMP_LESS_EQUAL, COMP_LIKE, COMP_NOT_EMPTY, COMP_NOT_EQUALS, COMP_NOT_IN, COMP_NOT_LIKE
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Constructor Summary
E4DBFilterAnd()
           
E4DBFilterAnd(E4ApplObj_Intf applobj)
           
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 java.lang.String getWhere()
           
 void isEmpty(E4DBColumnName fieldname)
          Set a filter using E4DBFilterOr on a column that can either be empty or null
 void isNotEmpty(E4DBColumnName fieldname)
          Set a filter on a column that may not be null and not be empty
 void isNotNull(E4DBColumnName fieldname)
          Set a filter on a column that must not be null
 void isNull(E4DBColumnName fieldname)
          Set a filter on a column that must be null
 E4DBFilterOr_Intf OR()
          Create an OR-where element, linked to this AND-es where.
 void setFilter_NOT(E4DBColumnName fieldname, E4Long[] filter)
          Creates a filter using the SQL NOT IN statement.
 void setFilter_NOT(E4DBColumnName fieldname, E4String[] filter)
          Creates a filter using the SQL NOT IN statement.
 void setFilter_NOT(E4DBColumnName fieldname, long[] filter)
          Creates a filter using the SQL NOT IN statement.
 void setFilter_NOT(E4DBColumnName fieldname, java.lang.String[] filter)
          Creates a filter using the SQL NOT IN statement.
 void setFilter(E4DBColumnName fieldname, boolean filter)
           
 void setFilter(E4DBColumnName fieldname, java.util.Calendar filter)
           
 void setFilter(E4DBColumnName fieldname, java.util.Date filter)
           
 void setFilter(E4DBColumnName fieldname, double filter)
           
 void setFilter(E4DBColumnName fieldname, E4Long filter)
           
 void setFilter(E4DBColumnName fieldname, E4Long[] filter)
          Creates a filter using the SQL IN statement.
 void setFilter(E4DBColumnName fieldname, E4String filter)
           
 void setFilter(E4DBColumnName fieldname, E4String[] filter)
          Creates a filter using the SQL NOT IN statement.
 void setFilter(E4DBColumnName fieldname, float filter)
           
 void setFilter(E4DBColumnName fieldname, int filter)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, boolean filter)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, java.util.Date filter)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, double filter)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, E4DBColumnName compareTo)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, E4Long filter)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, E4String filter)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, E4String filter, boolean quote)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, float filter)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, int filter)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, long filter)
           
 void setFilter(E4DBColumnName fieldname, int comp_operator, java.lang.String filter)
          Add an AND-ed filter to the where condition.
 void setFilter(E4DBColumnName fieldname, int comp_operator, java.lang.String filter, boolean quote)
          Add an AND-ed filter to the where condition.
 void setFilter(E4DBColumnName fieldname, long filter)
           
 void setFilter(E4DBColumnName fieldname, long[] filter)
          Creates a filter using the SQL IN statement.
 void setFilter(E4DBColumnName fieldname, java.lang.String filter)
           
 void setFilter(E4DBColumnName fieldname, java.lang.String[] filter)
          Creates a filter using the SQL IN statement.
 java.lang.String toString()
          Return the SQL clause.
 
Methods inherited from class e4s.db.E4DBFilter
Escape, Escape, finalize, getApplObj, getClient, getSession, getWhere, isWhereDefined, OP, resetWhere, setFilter_IN, setFilter_IN, setFilter_IN, setFilter_IN, setFilter_IN, setFilter_NOT_IN, setFilter_NOT_IN, setFilter_NOT_IN, setFilter_NOT_IN, setFilter_NOT_IN, setFilter, setFilter, setWhere, toString
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface e4s.db.E4DBFilter_Intf
isWhereDefined, resetWhere
 

Constructor Detail

E4DBFilterAnd

public E4DBFilterAnd(E4ApplObj_Intf applobj)

E4DBFilterAnd

public E4DBFilterAnd()
Method Detail

OR

public E4DBFilterOr_Intf OR()
Create an OR-where element, linked to this AND-es where.
 e.g.   E4DBSelect record = new E4DBSelect(new e4s.db.TableName("mytable"));
       record.setFilter("A",1);
       E4DBFilterOr or = record.OR();
       or.setFilter("B",2);
       or.setFilter("C",3);
 results in 
       SELECT * FROM mytable WHERE A=1 AND (B=2 OR C=3)
 

Specified by:
OR in interface E4DBFilterAnd_Intf
Returns:
the created and added OR-filter element.

isNull

public void isNull(E4DBColumnName fieldname)
            throws E4DBException
Set a filter on a column that must be null. [..x IS NULL..].

Specified by:
isNull in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the column to filter
Throws:
E4DBException
See Also:
isNotNull(e4s.db.E4DBColumnName), isEmpty(e4s.db.E4DBColumnName)

isNotEmpty

public void isNotEmpty(E4DBColumnName fieldname)
                throws E4DBException
Set a filter on a column that may not be null and not be empty. [..x IS NOT NULL AND x != ''..].

Specified by:
isNotEmpty in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the column to filter
Throws:
E4DBException
See Also:
isNotNull(e4s.db.E4DBColumnName), isEmpty(e4s.db.E4DBColumnName)

isEmpty

public void isEmpty(E4DBColumnName fieldname)
             throws E4DBException
Set a filter using E4DBFilterOr on a column that can either be empty or null. [..(x = '' OR x IS NULL)..].

Specified by:
isEmpty in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the column to filter
Throws:
E4DBException
See Also:
isNull(e4s.db.E4DBColumnName), isNotEmpty(e4s.db.E4DBColumnName)

isNotNull

public void isNotNull(E4DBColumnName fieldname)
               throws E4DBException
Set a filter on a column that must not be null. [..x IS NULL..].

Specified by:
isNotNull in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the column to filter
Throws:
E4DBException
See Also:
isNull(e4s.db.E4DBColumnName), isNotEmpty(e4s.db.E4DBColumnName)

setFilter

public void setFilter(E4DBColumnName fieldname,
                      long[] filter)
               throws E4DBException
Creates a filter using the SQL IN statement. Example: filter = {1,2,3} results in "fieldname IN (1,2,3)"

Specified by:
setFilter in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the name of the column
filter - an array of values
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      E4Long[] filter)
               throws E4DBException
Creates a filter using the SQL IN statement. Example: filter = {1,2,3} results in "fieldname IN (1,2,3)"

Specified by:
setFilter in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the name of the column
filter - an array of values
Throws:
E4DBException

setFilter_NOT

public void setFilter_NOT(E4DBColumnName fieldname,
                          long[] filter)
                   throws E4DBException
Creates a filter using the SQL NOT IN statement. Example: filter = {1,2,3} results in "fieldname IN (1,2,3)"

Specified by:
setFilter_NOT in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the name of the column
filter - an array of values
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      E4String[] filter)
               throws E4DBException
Creates a filter using the SQL NOT IN statement. Example: filter = {"A","B","C"} results in "fieldname IN ('A','B','C')"

Specified by:
setFilter in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the name of the column
filter - an array of values
Throws:
E4DBException

setFilter_NOT

public void setFilter_NOT(E4DBColumnName fieldname,
                          E4Long[] filter)
                   throws E4DBException
Creates a filter using the SQL NOT IN statement. Example: filter = {1,2,3} results in "fieldname IN (1,2,3)"

Specified by:
setFilter_NOT in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the name of the column
filter - an array of values
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      java.lang.String[] filter)
               throws E4DBException
Creates a filter using the SQL IN statement. Example: filter = {"A","B"} results in "fieldname IN ('A','B')"

Specified by:
setFilter in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the name of the column
filter - an array of values
Throws:
E4DBException

setFilter_NOT

public void setFilter_NOT(E4DBColumnName fieldname,
                          java.lang.String[] filter)
                   throws E4DBException
Creates a filter using the SQL NOT IN statement. Example: filter = {"A","B"} results in "fieldname NOT IN ('A','B')"

Specified by:
setFilter_NOT in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the name of the column
filter - an array of values
Throws:
E4DBException

setFilter_NOT

public void setFilter_NOT(E4DBColumnName fieldname,
                          E4String[] filter)
                   throws E4DBException
Creates a filter using the SQL NOT IN statement. Example: filter = {"A","B"} results in "fieldname NOT IN ('A','B')"

Specified by:
setFilter_NOT in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the name of the column
filter - an array of values
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      java.lang.String filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      java.lang.String filter)
               throws E4DBException
Add an AND-ed filter to the where condition.

Specified by:
setFilter in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the fieldname
comp_operator - the comparsion operator (see E4DBFilter.COMP_EQUALS and others)
filter - the expression to be evaluated, add quotes before and after
Throws:
E4DBException
See Also:
setFilter(e4s.db.E4DBColumnName, long[])

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      java.lang.String filter,
                      boolean quote)
               throws E4DBException
Add an AND-ed filter to the where condition.

Specified by:
setFilter in interface E4DBFilterAnd_Intf
Parameters:
fieldname - the fieldname
comp_operator - the comparsion operator (see E4DBFilter.COMP_EQUALS and others)
filter - the expression to be evaluated
quote - true: add quotes to the expression when SQL statement is created, false expect quotes are set correctly within filter
Throws:
E4DBException
See Also:
setFilter(e4s.db.E4DBColumnName, long[])

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      long filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      long filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      double filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      double filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      float filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      float filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      boolean filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      boolean filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      int filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      java.util.Date filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      java.util.Date filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      java.util.Calendar filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      E4String filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      E4String filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      E4String filter,
                      boolean quote)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      E4Long filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      E4Long filter)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

setFilter

public void setFilter(E4DBColumnName fieldname,
                      int comp_operator,
                      E4DBColumnName compareTo)
               throws E4DBException
Specified by:
setFilter in interface E4DBFilterAnd_Intf
Throws:
E4DBException

getWhere

public java.lang.String getWhere()
Specified by:
getWhere in interface E4DBFilter_Intf
Specified by:
getWhere in interface E4DBFilterAnd_Intf

toString

public java.lang.String toString()
Return the SQL clause.

Overrides:
toString in class E4Object

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com