public class SubqueryCompareCriteria extends AbstractCompareCriteria implements SubqueryContainer<QueryCommand>, ContextReference
This class implements a quantified comparison predicate. This is a criteria which represents a simple operator relationship between an expression and either a scalar subquery or a table subquery preceded by one of the possible quantifiers.
The quantifiers are:
#NO_QUANTIFIER
, meaning the subquery has no quantifier and therefore must be
a scalar subquerySOME
and ANY
, which are synonymous - the criteria is true if there is at
least one comparison between the left expression and the values of the subquery. The criteria
is false if the subquery returns no rows.ALL
Some examples are:
PredicateCriteria.Negatable
SubqueryContainer.Evaluatable<T extends Command>
LanguageObject.Util
Modifier and Type | Field and Description |
---|---|
static int |
ALL
"All" predicate quantifier
|
static int |
ANY
"Any" predicate quantifier (equivalent to "Some")
|
static int |
SOME
"Some" predicate quantifier (equivalent to "Any")
|
Constructor and Description |
---|
SubqueryCompareCriteria() |
SubqueryCompareCriteria(Expression leftExpression,
QueryCommand subCommand,
int operator,
int predicateQuantifier) |
Modifier and Type | Method and Description |
---|---|
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.
|
Object |
clone()
Deep copy of object.
|
boolean |
equals(Object obj)
Override equals() method.
|
Expression |
getArrayExpression() |
QueryCommand |
getCommand()
Returns the subquery Command object
|
String |
getContextSymbol() |
int |
getPredicateQuantifier()
|
String |
getPredicateQuantifierAsString()
Returns the predicate quantifier as a string.
|
ExistsCriteria.SubqueryHint |
getSubqueryHint() |
int |
hashCode()
Get hash code.
|
void |
negate() |
void |
setArrayExpression(Expression expression) |
void |
setCommand(QueryCommand command)
Set the subquery command (either a SELECT or a procedure execution).
|
void |
setPredicateQuantifier(int predicateQuantifier)
|
void |
setSubqueryHint(ExistsCriteria.SubqueryHint subqueryHint) |
getInverseOperator, getLeftExpression, getOperator, getOperator, getOperatorAsString, setLeftExpression, setOperator
applyDemorgan, combineCriteria, combineCriteria, combineCriteria, getType, separateCriteriaByAnd, toString
public static final int SOME
public static final int ANY
public static final int ALL
public SubqueryCompareCriteria()
public SubqueryCompareCriteria(Expression leftExpression, QueryCommand subCommand, int operator, int predicateQuantifier)
public String getContextSymbol()
getContextSymbol
in interface ContextReference
public int getPredicateQuantifier()
public void setPredicateQuantifier(int predicateQuantifier)
predicateQuantifier
- the predicate quantifierpublic QueryCommand getCommand()
SubqueryContainer
getCommand
in interface SubqueryContainer<QueryCommand>
public void setCommand(QueryCommand command)
setCommand
in interface SubqueryContainer<QueryCommand>
command
- Command to execute to get the values for the criteriapublic String getPredicateQuantifierAsString()
public void acceptVisitor(LanguageVisitor visitor)
LanguageObject
acceptVisitor
in interface LanguageObject
visitor
- Visitor being usedpublic int hashCode()
public boolean equals(Object obj)
public Object clone()
clone
in interface LanguageObject
clone
in class PredicateCriteria
Object.clone()
public void negate()
negate
in interface PredicateCriteria.Negatable
negate
in class AbstractCompareCriteria
public ExistsCriteria.SubqueryHint getSubqueryHint()
public void setSubqueryHint(ExistsCriteria.SubqueryHint subqueryHint)
public Expression getArrayExpression()
public void setArrayExpression(Expression expression)
Copyright © 2019. All rights reserved.