org.castor.cpa.persistence.sql.query.condition
Class OrCondition

java.lang.Object
  extended by org.castor.cpa.persistence.sql.query.QueryObject
      extended by org.castor.cpa.persistence.sql.query.condition.Condition
          extended by org.castor.cpa.persistence.sql.query.condition.CompoundCondition
              extended by org.castor.cpa.persistence.sql.query.condition.OrCondition

public final class OrCondition
extends CompoundCondition

Represents a list of conditions that are concatenated by an OR operator.

Version:
$Revision$ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
Author:
Ahmad Hassan, Ralf Joachim

Constructor Summary
OrCondition()
          Default constructor for an empty OR condition.
OrCondition(Condition condition1, Condition condition2)
          Constructor for a compound condition that concatenates the 2 given conditions with an OR operator.
OrCondition(OrCondition condition)
          Copy constructor to create a copy of given OR condition.
 
Method Summary
protected  void append(Condition condition)
          Appends the specified condition to end of this list of conditions.
 Condition not()
          Builder method to invert a condition.
 Condition or(Condition condition)
          Builder method to concatenate the given condition with all others that have previously been added with an OR operator.
 void toString(QueryContext ctx)
          Append a string representation of the object to the given QueryContext.
 
Methods inherited from class org.castor.cpa.persistence.sql.query.condition.CompoundCondition
insert, iterator
 
Methods inherited from class org.castor.cpa.persistence.sql.query.condition.Condition
and
 
Methods inherited from class org.castor.cpa.persistence.sql.query.QueryObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrCondition

public OrCondition()
Default constructor for an empty OR condition.


OrCondition

public OrCondition(Condition condition1,
                   Condition condition2)
Constructor for a compound condition that concatenates the 2 given conditions with an OR operator.

Parameters:
condition1 - First condition.
condition2 - Second condition.

OrCondition

public OrCondition(OrCondition condition)
Copy constructor to create a copy of given OR condition.

Parameters:
condition - OR 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 class CompoundCondition
Parameters:
condition - Condition to be appended to this list of conditions.

or

public Condition or(Condition condition)
Description copied from class: Condition
Builder method to concatenate the given condition with all others that have previously been added with an OR operator.

Overrides:
or in class Condition
Parameters:
condition - Condition to concatenate.
Returns:
Resulting condition object.

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.

Specified by:
not in class Condition
Returns:
Negated condition.

toString

public void toString(QueryContext ctx)
Description copied from class: QueryObject
Append a string representation of the object to the given QueryContext. In general, this toString method appends a string that "textually represents" this object. The result should be a string in valid SQL syntax. It is required that all subclasses override this method.

Specified by:
toString in class QueryObject
Parameters:
ctx - QueryContext to append the string representation of the object to.


Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com