org.opencms.db
Class CmsSqlBooleanClause

java.lang.Object
  extended by org.opencms.db.CmsSqlBooleanClause
All Implemented Interfaces:
I_CmsQueryFragment

public class CmsSqlBooleanClause
extends Object
implements I_CmsQueryFragment

Class for generating an SQL boolean expression.

Since:
8.0.0

Constructor Summary
CmsSqlBooleanClause(String operator)
          Creates a new boolean clause.
 
Method Summary
 CmsSqlBooleanClause addCondition(I_CmsQueryFragment fragment)
          Adds an operand to the boolean expression.
static CmsSqlBooleanClause makeAnd(I_CmsQueryFragment... fragments)
          Creates a boolean "AND" expression.
static CmsSqlBooleanClause makeOr(I_CmsQueryFragment... fragments)
          Creates a boolean "OR" expression.
 void visit(CmsStatementBuilder builder)
          Generates the SQL and parameters and sends them to the statement builder .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsSqlBooleanClause

public CmsSqlBooleanClause(String operator)
Creates a new boolean clause.

Parameters:
operator - the boolean operator
Method Detail

makeAnd

public static CmsSqlBooleanClause makeAnd(I_CmsQueryFragment... fragments)
Creates a boolean "AND" expression.

Parameters:
fragments - the operands of the "AND"
Returns:
the combined expression

makeOr

public static CmsSqlBooleanClause makeOr(I_CmsQueryFragment... fragments)
Creates a boolean "OR" expression.

Parameters:
fragments - the operands of the "OR"
Returns:
the combined expressiong

addCondition

public CmsSqlBooleanClause addCondition(I_CmsQueryFragment fragment)
Adds an operand to the boolean expression.

Parameters:
fragment - the operand
Returns:
this object instance

visit

public void visit(CmsStatementBuilder builder)
Description copied from interface: I_CmsQueryFragment
Generates the SQL and parameters and sends them to the statement builder .

Specified by:
visit in interface I_CmsQueryFragment
Parameters:
builder - the statement builder
See Also:
I_CmsQueryFragment.visit(org.opencms.db.CmsStatementBuilder)