Class CriteriaVisitor
- java.lang.Object
-
- org.teiid.language.visitor.AbstractLanguageVisitor
-
- org.teiid.language.visitor.HierarchyVisitor
-
- org.teiid.translator.salesforce.execution.visitors.CriteriaVisitor
-
- All Implemented Interfaces:
LanguageObjectVisitor
,ICriteriaVisitor
- Direct Known Subclasses:
DeleteVisitor
,InsertVisitor
,SelectVisitor
,UpdateVisitor
public class CriteriaVisitor extends HierarchyVisitor implements ICriteriaVisitor
Parses Criteria in support of all of the ExecutionImpl classes.
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
APOS
protected static String
CLOSE
protected static String
COMMA
protected List<String>
criteriaBuffer
protected List<TranslatorException>
exceptions
protected static String
EXCLUDES
protected static String
FROM
protected boolean
hasCriteria
protected In
idInCriteria
protected static String
INCLUDES
protected static String
LIMIT
protected RuntimeMetadata
metadata
protected static String
OPEN
protected static String
ORDER_BY
protected boolean
queryAll
protected static String
SELECT
protected static String
SEMI
protected static String
SPACE
protected NamedTable
table
protected static String
WHERE
-
Constructor Summary
Constructors Constructor Description CriteriaVisitor(RuntimeMetadata metadata)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addCompareCriteria(Comparison compCriteria)
protected void
addCriteriaString(StringBuilder result)
protected void
addCriteriaString(String clause, StringBuilder result)
protected void
appendAggregateFunction(StringBuilder result, AggregateFunction af)
static void
appendLiteralValue(StringBuilder result, Literal literal)
String
getTableName()
protected String
getValue(Expression expr, boolean raw)
boolean
hasCriteria()
boolean
hasOnlyIDCriteria()
protected boolean
isIdColumn(Expression expression)
protected boolean
isMultiSelectColumn(Expression expression)
protected void
loadColumnMetadata(NamedTable group)
void
parseFunction(Function func)
void
setHasCriteria(boolean hasCriteria, boolean isIdCriteria)
void
visit(AndOr obj)
void
visit(Comparison criteria)
void
visit(In criteria)
void
visit(IsNull obj)
void
visit(Like criteria)
void
visit(Not obj)
-
Methods inherited from class org.teiid.language.visitor.HierarchyVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Methods inherited from class org.teiid.language.visitor.AbstractLanguageVisitor
visit, visit, visit, visit, visit, visit, visit, visitNode, visitNodes, visitNodes
-
-
-
-
Field Detail
-
SELECT
protected static final String SELECT
- See Also:
- Constant Field Values
-
FROM
protected static final String FROM
- See Also:
- Constant Field Values
-
WHERE
protected static final String WHERE
- See Also:
- Constant Field Values
-
ORDER_BY
protected static final String ORDER_BY
- See Also:
- Constant Field Values
-
LIMIT
protected static final String LIMIT
- See Also:
- Constant Field Values
-
SPACE
protected static final String SPACE
- See Also:
- Constant Field Values
-
EXCLUDES
protected static final String EXCLUDES
- See Also:
- Constant Field Values
-
INCLUDES
protected static final String INCLUDES
- See Also:
- Constant Field Values
-
COMMA
protected static final String COMMA
- See Also:
- Constant Field Values
-
SEMI
protected static final String SEMI
- See Also:
- Constant Field Values
-
APOS
protected static final String APOS
- See Also:
- Constant Field Values
-
OPEN
protected static final String OPEN
- See Also:
- Constant Field Values
-
CLOSE
protected static final String CLOSE
- See Also:
- Constant Field Values
-
metadata
protected RuntimeMetadata metadata
-
hasCriteria
protected boolean hasCriteria
-
exceptions
protected List<TranslatorException> exceptions
-
table
protected NamedTable table
-
queryAll
protected boolean queryAll
-
idInCriteria
protected In idInCriteria
-
-
Constructor Detail
-
CriteriaVisitor
public CriteriaVisitor(RuntimeMetadata metadata)
-
-
Method Detail
-
visit
public void visit(Comparison criteria)
- Specified by:
visit
in interfaceLanguageObjectVisitor
- Overrides:
visit
in classHierarchyVisitor
-
visit
public void visit(IsNull obj)
- Specified by:
visit
in interfaceLanguageObjectVisitor
- Overrides:
visit
in classHierarchyVisitor
-
visit
public void visit(Like criteria)
- Specified by:
visit
in interfaceLanguageObjectVisitor
- Overrides:
visit
in classHierarchyVisitor
-
visit
public void visit(AndOr obj)
- Specified by:
visit
in interfaceLanguageObjectVisitor
- Overrides:
visit
in classHierarchyVisitor
-
visit
public void visit(Not obj)
- Specified by:
visit
in interfaceLanguageObjectVisitor
- Overrides:
visit
in classHierarchyVisitor
-
visit
public void visit(In criteria)
- Specified by:
visit
in interfaceLanguageObjectVisitor
- Overrides:
visit
in classHierarchyVisitor
-
parseFunction
public void parseFunction(Function func)
-
addCompareCriteria
protected void addCompareCriteria(Comparison compCriteria)
-
getValue
protected String getValue(Expression expr, boolean raw)
-
appendLiteralValue
public static void appendLiteralValue(StringBuilder result, Literal literal)
-
appendAggregateFunction
protected void appendAggregateFunction(StringBuilder result, AggregateFunction af)
-
loadColumnMetadata
protected void loadColumnMetadata(NamedTable group) throws TranslatorException
- Throws:
TranslatorException
-
isIdColumn
protected boolean isIdColumn(Expression expression)
-
isMultiSelectColumn
protected boolean isMultiSelectColumn(Expression expression)
-
hasCriteria
public boolean hasCriteria()
- Specified by:
hasCriteria
in interfaceICriteriaVisitor
-
setHasCriteria
public void setHasCriteria(boolean hasCriteria, boolean isIdCriteria)
-
hasOnlyIDCriteria
public boolean hasOnlyIDCriteria()
- Specified by:
hasOnlyIDCriteria
in interfaceICriteriaVisitor
-
getTableName
public String getTableName()
- Specified by:
getTableName
in interfaceICriteriaVisitor
-
addCriteriaString
protected void addCriteriaString(StringBuilder result)
-
addCriteriaString
protected void addCriteriaString(String clause, StringBuilder result)
-
-