Package org.opencms.db
Class CmsSqlBooleanClause
- java.lang.Object
-
- org.opencms.db.CmsSqlBooleanClause
-
- All Implemented Interfaces:
I_CmsQueryFragment
public class CmsSqlBooleanClause extends java.lang.Object implements I_CmsQueryFragment
Class for generating an SQL boolean expression.- Since:
- 8.0.0
-
-
Constructor Summary
Constructors Constructor Description CmsSqlBooleanClause(java.lang.String operator)
Creates a new boolean clause.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 .
-
-
-
Constructor Detail
-
CmsSqlBooleanClause
public CmsSqlBooleanClause(java.lang.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 interfaceI_CmsQueryFragment
- Parameters:
builder
- the statement builder- See Also:
I_CmsQueryFragment.visit(org.opencms.db.CmsStatementBuilder)
-
-