Package org.nuxeo.ecm.directory.sql
Class SQLQueryBuilder
- java.lang.Object
-
- org.nuxeo.ecm.core.query.sql.model.DefaultQueryVisitor
-
- org.nuxeo.ecm.directory.sql.SQLQueryBuilder
-
- All Implemented Interfaces:
IVisitor
public class SQLQueryBuilder extends DefaultQueryVisitor
Builds the database-level WHERE query from the AST, and collects parameters associated to free variables along with the database column to which they correspond.- Since:
- 10.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SQLQueryBuilder.ColumnAndValue
-
Field Summary
Fields Modifier and Type Field Description StringBuilder
clause
protected SQLDirectory
directory
List<SQLQueryBuilder.ColumnAndValue>
params
protected Column
visitedColumn
-
Constructor Summary
Constructors Constructor Description SQLQueryBuilder(SQLDirectory directory)
-
Method Summary
-
Methods inherited from class org.nuxeo.ecm.core.query.sql.model.DefaultQueryVisitor
visitFromClause, visitGroupByClause, visitHavingClause, visitLiteral, visitOperandList, visitOrderByClause, visitOrderByExpr, visitOrderByList, visitQuery, visitReferenceList, visitSelectClause, visitWhereClause
-
-
-
-
Field Detail
-
directory
protected final SQLDirectory directory
-
clause
public final StringBuilder clause
-
params
public final List<SQLQueryBuilder.ColumnAndValue> params
-
visitedColumn
protected Column visitedColumn
-
-
Constructor Detail
-
SQLQueryBuilder
public SQLQueryBuilder(SQLDirectory directory)
-
-
Method Detail
-
visitMultiExpression
public void visitMultiExpression(MultiExpression node)
- Specified by:
visitMultiExpression
in interfaceIVisitor
- Overrides:
visitMultiExpression
in classDefaultQueryVisitor
-
visitExpression
public void visitExpression(Expression node)
- Specified by:
visitExpression
in interfaceIVisitor
- Overrides:
visitExpression
in classDefaultQueryVisitor
-
visitExpressionBetween
protected void visitExpressionBetween(Column column, Operator op, LiteralList list)
-
visitExpressionILike
protected void visitExpressionILike(Column column, Operator op, Operand rvalue)
-
addLikeEscaping
protected void addLikeEscaping()
-
visitOperator
public void visitOperator(Operator node)
- Specified by:
visitOperator
in interfaceIVisitor
- Overrides:
visitOperator
in classDefaultQueryVisitor
-
visitReference
public void visitReference(Reference node)
- Specified by:
visitReference
in interfaceIVisitor
- Overrides:
visitReference
in classDefaultQueryVisitor
-
visitColumn
protected void visitColumn(Column column)
-
visitLiteralList
public void visitLiteralList(LiteralList node)
- Specified by:
visitLiteralList
in interfaceIVisitor
- Overrides:
visitLiteralList
in classDefaultQueryVisitor
-
visitDateLiteral
public void visitDateLiteral(DateLiteral node)
- Specified by:
visitDateLiteral
in interfaceIVisitor
- Overrides:
visitDateLiteral
in classDefaultQueryVisitor
-
visitStringLiteral
public void visitStringLiteral(StringLiteral node)
- Specified by:
visitStringLiteral
in interfaceIVisitor
- Overrides:
visitStringLiteral
in classDefaultQueryVisitor
-
visitDoubleLiteral
public void visitDoubleLiteral(DoubleLiteral node)
- Specified by:
visitDoubleLiteral
in interfaceIVisitor
- Overrides:
visitDoubleLiteral
in classDefaultQueryVisitor
-
visitIntegerLiteral
public void visitIntegerLiteral(IntegerLiteral node)
- Specified by:
visitIntegerLiteral
in interfaceIVisitor
- Overrides:
visitIntegerLiteral
in classDefaultQueryVisitor
-
visitBooleanLiteral
public void visitBooleanLiteral(BooleanLiteral node)
- Specified by:
visitBooleanLiteral
in interfaceIVisitor
- Overrides:
visitBooleanLiteral
in classDefaultQueryVisitor
-
visitFunction
public void visitFunction(Function node)
- Specified by:
visitFunction
in interfaceIVisitor
- Overrides:
visitFunction
in classDefaultQueryVisitor
-
-