org.teiid.query.sql.lang
Class ExistsCriteria

java.lang.Object
  extended by org.teiid.query.sql.lang.Criteria
      extended by org.teiid.query.sql.lang.PredicateCriteria
          extended by org.teiid.query.sql.lang.ExistsCriteria
All Implemented Interfaces:
Cloneable, PredicateCriteria.Negatable, SubqueryContainer<QueryCommand>, LanguageObject, ContextReference, Expression

public class ExistsCriteria
extends PredicateCriteria
implements SubqueryContainer<QueryCommand>, ContextReference, PredicateCriteria.Negatable

This predicate criteria implements the "exists" predicate, which has a subquery in it. For example, "EXISTS (Select EmployeeID FROM Employees WHERE EmployeeName = 'Smith')".


Nested Class Summary
static class ExistsCriteria.SubqueryHint
           
 
Nested classes/interfaces inherited from class org.teiid.query.sql.lang.PredicateCriteria
PredicateCriteria.Negatable
 
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
 
Constructor Summary
ExistsCriteria()
          Default constructor
ExistsCriteria(QueryCommand subqueryCommand)
           
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 Object clone()
          Deep copy of object.
 boolean equals(Object obj)
          Override equals() method.
 QueryCommand getCommand()
          Returns the subquery Command object
 String getContextSymbol()
           
 ExistsCriteria.SubqueryHint getSubqueryHint()
           
 Expression getValueExpression()
           
 int hashCode()
          Get hash code.
 boolean isNegated()
           
 void negate()
           
 void setCommand(QueryCommand subqueryCommand)
          Sets the subquery Command object
 void setNegated(boolean negated)
           
 void setShouldEvaluate(boolean shouldEvaluate)
           
 void setSubqueryHint(ExistsCriteria.SubqueryHint subqueryHint)
           
 boolean shouldEvaluate()
           
 
Methods inherited from class org.teiid.query.sql.lang.Criteria
applyDemorgan, combineCriteria, combineCriteria, combineCriteria, getType, isResolved, separateCriteriaByAnd, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExistsCriteria

public ExistsCriteria()
Default constructor


ExistsCriteria

public ExistsCriteria(QueryCommand subqueryCommand)
Method Detail

shouldEvaluate

public boolean shouldEvaluate()

setShouldEvaluate

public void setShouldEvaluate(boolean shouldEvaluate)

getContextSymbol

public String getContextSymbol()
Specified by:
getContextSymbol in interface ContextReference

getValueExpression

public Expression getValueExpression()
Specified by:
getValueExpression in interface ContextReference

getCommand

public QueryCommand getCommand()
Description copied from interface: SubqueryContainer
Returns the subquery Command object

Specified by:
getCommand in interface SubqueryContainer<QueryCommand>
Returns:
the subquery Command object

setCommand

public void setCommand(QueryCommand subqueryCommand)
Description copied from interface: SubqueryContainer
Sets the subquery Command object

Specified by:
setCommand in interface SubqueryContainer<QueryCommand>
Parameters:
subqueryCommand - the subquery Command object

acceptVisitor

public void acceptVisitor(LanguageVisitor visitor)
Description copied from interface: LanguageObject
Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.

Specified by:
acceptVisitor in interface LanguageObject
Parameters:
visitor - Visitor being used

hashCode

public int hashCode()
Get hash code. WARNING: The hash code is based on data in the criteria. If data values are changed, the hash code will change - don't hash this object and change values.

Overrides:
hashCode in class Object
Returns:
Hash code

equals

public boolean equals(Object obj)
Override equals() method.

Overrides:
equals in class Object
Parameters:
obj - Other object
Returns:
True if equal

getSubqueryHint

public ExistsCriteria.SubqueryHint getSubqueryHint()

setSubqueryHint

public void setSubqueryHint(ExistsCriteria.SubqueryHint subqueryHint)

clone

public Object clone()
Deep copy of object. The values Iterator of this object will not be cloned - it will be null in the new object (see #setValueIterator setValueIterator}).

Specified by:
clone in interface LanguageObject
Specified by:
clone in class PredicateCriteria
Returns:
Deep copy of object
See Also:
Object.clone()

isNegated

public boolean isNegated()

setNegated

public void setNegated(boolean negated)

negate

public void negate()
Specified by:
negate in interface PredicateCriteria.Negatable


Copyright © 2011. All Rights Reserved.