Package org.teiid.query.sql.symbol
Class ScalarSubquery
- java.lang.Object
-
- org.teiid.query.sql.symbol.ScalarSubquery
-
- All Implemented Interfaces:
Cloneable
,SubqueryContainer<QueryCommand>
,SubqueryContainer.Evaluatable<QueryCommand>
,LanguageObject
,ContextReference
,Expression
public class ScalarSubquery extends Object implements Expression, SubqueryContainer.Evaluatable<QueryCommand>, ContextReference
This is an Expression implementation that can be used in a SELECT clause. It has a subquery Command which must only produce exactly one value (or an Exception will result during query processing). It's type will be the type of the one symbol to be produced. In theory an instance of this could be used wherever an Expression is legal, but it is specifically needed for the SELECT clause.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
-
Nested classes/interfaces inherited from interface org.teiid.query.sql.lang.SubqueryContainer
SubqueryContainer.Evaluatable<T extends Command>
-
-
Constructor Summary
Constructors Constructor Description ScalarSubquery(QueryCommand subqueryCommand)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.Object
clone()
Returns a safe cloneboolean
equals(Object obj)
Compare this ScalarSubquery to another ScalarSubquery for equality.QueryCommand
getCommand()
Returns the subquery Command objectString
getContextSymbol()
ExistsCriteria.SubqueryHint
getSubqueryHint()
Class<?>
getType()
Get the return type of this expression.int
hashCode()
Get hashcode for the objectvoid
setCommand(QueryCommand command)
Sets the command.void
setShouldEvaluate(boolean shouldEvaluate)
void
setSubqueryHint(ExistsCriteria.SubqueryHint subqueryHint)
void
setType(Class<?> type)
Set type of ScalarSubqueryboolean
shouldEvaluate()
String
toString()
Returns string representation of this object.
-
-
-
Constructor Detail
-
ScalarSubquery
public ScalarSubquery(QueryCommand subqueryCommand)
-
-
Method Detail
-
shouldEvaluate
public boolean shouldEvaluate()
- Specified by:
shouldEvaluate
in interfaceSubqueryContainer.Evaluatable<QueryCommand>
-
setShouldEvaluate
public void setShouldEvaluate(boolean shouldEvaluate)
- Specified by:
setShouldEvaluate
in interfaceSubqueryContainer.Evaluatable<QueryCommand>
-
getContextSymbol
public String getContextSymbol()
- Specified by:
getContextSymbol
in interfaceContextReference
-
getType
public Class<?> getType()
Description copied from interface:Expression
Get the return type of this expression.- Specified by:
getType
in interfaceExpression
- Returns:
- Java class may be null prior to being resolved
- See Also:
Expression.getType()
-
setType
public void setType(Class<?> type)
Set type of ScalarSubquery- Parameters:
type
- New type
-
getCommand
public QueryCommand getCommand()
Description copied from interface:SubqueryContainer
Returns the subquery Command object- Specified by:
getCommand
in interfaceSubqueryContainer<QueryCommand>
- Returns:
- the subquery Command object
-
setCommand
public void setCommand(QueryCommand command)
Sets the command.- Specified by:
setCommand
in interfaceSubqueryContainer<QueryCommand>
- Parameters:
command
- 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 interfaceLanguageObject
- Parameters:
visitor
- Visitor being used
-
equals
public boolean equals(Object obj)
Compare this ScalarSubquery to another ScalarSubquery for equality.
-
hashCode
public int hashCode()
Get hashcode for the object
-
clone
public Object clone()
Returns a safe clone- Specified by:
clone
in interfaceLanguageObject
- Overrides:
clone
in classObject
- Returns:
- Deep clone of this object
- See Also:
Object.clone()
-
toString
public String toString()
Returns string representation of this object.
-
getSubqueryHint
public ExistsCriteria.SubqueryHint getSubqueryHint()
-
setSubqueryHint
public void setSubqueryHint(ExistsCriteria.SubqueryHint subqueryHint)
-
-