Class AndCondition
- java.lang.Object
-
- org.castor.cpa.persistence.sql.query.condition.Condition
-
- org.castor.cpa.persistence.sql.query.condition.CompoundCondition
-
- org.castor.cpa.persistence.sql.query.condition.AndCondition
-
- All Implemented Interfaces:
QueryObject
public final class AndCondition extends CompoundCondition
Represents a list of conditions that are concatenated by an AND operator.- Version:
- $Revision$ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
- Author:
- Ahmad Hassan, Ralf Joachim
-
-
Constructor Summary
Constructors Constructor Description AndCondition()
Default constructor for an empty AND condition.AndCondition(AndCondition condition)
Copy constructor to create a copy of given AND condition.AndCondition(Condition condition1, Condition condition2)
Constructor for a compound condition that concatenates the 2 given conditions with an AND operator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor)
Accept method to handle incoming visitors.Condition
and(Condition condition)
Builder method to concatenate the given condition with all others that have previously been added with an AND operator.protected void
append(Condition condition)
Appends the specified condition to end of this list of conditions.Condition
not()
Builder method to invert a condition.java.lang.String
toString()
Method constructing query string.-
Methods inherited from class org.castor.cpa.persistence.sql.query.condition.CompoundCondition
insert, iterator
-
-
-
-
Constructor Detail
-
AndCondition
public AndCondition()
Default constructor for an empty AND condition.
-
AndCondition
public AndCondition(Condition condition1, Condition condition2)
Constructor for a compound condition that concatenates the 2 given conditions with an AND operator.- Parameters:
condition1
- First condition.condition2
- Second condition.
-
AndCondition
public AndCondition(AndCondition condition)
Copy constructor to create a copy of given AND condition.- Parameters:
condition
- AND condition to create a copy of.
-
-
Method Detail
-
append
protected void append(Condition condition)
Description copied from class:CompoundCondition
Appends the specified condition to end of this list of conditions.- Overrides:
append
in classCompoundCondition
- Parameters:
condition
- Condition to be appended to this list of conditions.
-
and
public Condition and(Condition condition)
Description copied from class:Condition
Builder method to concatenate the given condition with all others that have previously been added with an AND operator.
-
not
public Condition not()
Description copied from class:Condition
Builder method to invert a condition. A condition that evaluated to TRUE before calling this method will evaluate to FALSE thereafter.
-
accept
public void accept(Visitor visitor)
Accept method to handle incoming visitors.- Parameters:
visitor
- Visitor to be handled.
-
toString
public java.lang.String toString()
Method constructing query string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Constructed query string.
-
-