protected class NXQLQueryMaker.WhereBuilder extends DefaultQueryVisitor
Modifier and Type | Field and Description |
---|---|
protected boolean |
aliasOrderByColumns |
protected boolean |
allowSubSelect |
protected int |
arraySubQueryJoinCount |
StringBuilder |
buf |
protected int |
ftJoinNumber |
protected Dialect.FulltextMatchInfo |
ftMatchInfo |
protected int |
hierJoinCount |
protected boolean |
inOrderBy |
protected boolean |
inSelect |
protected boolean |
isProxies |
static String |
PATH_SEP |
protected Map<String,Column> |
posColumns |
protected List<Column> |
posColumnsInOrderBy |
protected Map<String,Dialect.ArraySubQuery> |
propertyArraySubQueries |
protected Map<String,Table> |
propertyHierTables |
protected int |
uniqueJoinIndex |
protected boolean |
visitingId |
LinkedList<Column> |
whatColumns |
LinkedList<String> |
whatKeys |
Constructor and Description |
---|
WhereBuilder(boolean isProxies) |
Modifier and Type | Method and Description |
---|---|
protected void |
addLikeEscaping() |
protected void |
checkDateLiteralForCast(Operand value,
Expression node)
This operand is going to be used with a lvalue that has a DATE cast, so if it's a date literal make sure it's
not a TIMESTAMP.
|
protected void |
generateExistsEnd(StringBuilder buf) |
protected void |
generateExistsStart(StringBuilder buf,
Table table) |
protected ColumnType |
getAggregateType(String func,
ColumnType arg) |
protected Dialect.ArraySubQuery |
getArraySubQuery(Table contextHier,
String contextKey,
Column arrayColumn,
boolean skipJoin)
Gets the arraySubquery for the given arrayColumn in the given contextKey, and maybe adds a JOIN if one is not
already done.
|
protected Operand |
getBooleanLiteral(Operand rvalue) |
NXQLQueryMaker.ColumnInfo |
getColumnInfo(String name)
Finds info about column (special or not).
|
protected NXQLQueryMaker.ColumnInfo |
getRegularColumnInfo(String xpath)
Gets column information for a regular property.
|
protected NXQLQueryMaker.ColumnInfo |
getSpecialColumnInfo(String name) |
protected int |
getUniqueJoinIndex() |
void |
visitBooleanLiteral(BooleanLiteral node) |
protected void |
visitColumnExpression(Column column,
Operator op,
Operand rvalue,
String cast,
String lvalueName,
int arrayElementIndex) |
void |
visitDateLiteral(DateLiteral node) |
void |
visitDoubleLiteral(DoubleLiteral node) |
void |
visitExpression(Expression node) |
protected void |
visitExpressionAncestorId(Expression node) |
protected void |
visitExpressionEcmPath(Expression node) |
protected void |
visitExpressionEqOrIn(Column column,
Operator op,
Operand rvalue,
String cast,
int arrayElementIndex) |
protected void |
visitExpressionFulltext(Expression node,
String name) |
protected void |
visitExpressionIlike(Column column,
Operator op,
Operand rvalue,
String lvalueName,
int arrayElementIndex) |
protected void |
visitExpressionIsProxy(Expression node) |
protected void |
visitExpressionLike(Column column,
Operator op,
Operand rvalue,
String lvalueName,
int arrayElementIndex) |
protected void |
visitExpressionMixinType(Expression expr)
Include or exclude mixins.
|
protected void |
visitExpressionStartsWith(Expression node) |
protected void |
visitExpressionStartsWithNonPath(Expression node,
String path) |
protected void |
visitExpressionStartsWithPath(String path) |
protected void |
visitExpressionWhereFalseIsNull(Expression node) |
protected void |
visitExpressionWhereFalseMayBeNull(Expression node) |
void |
visitFunction(Function node) |
protected void |
visitId(String string) |
void |
visitIntegerLiteral(IntegerLiteral node) |
void |
visitLiteralList(LiteralList node) |
void |
visitMultiExpression(MultiExpression node) |
void |
visitOperator(Operator node) |
void |
visitOrderByExpr(OrderByExpr node) |
void |
visitOrderByList(OrderByList node) |
void |
visitOrderByPosColumns() |
void |
visitQuery(SQLQuery node) |
protected void |
visitReference(Column column) |
protected void |
visitReference(Column column,
int arrayElementIndex) |
protected void |
visitReference(Column column,
String cast) |
protected void |
visitReference(Column column,
String cast,
int arrayElementIndex) |
void |
visitReference(Reference node) |
protected void |
visitScore() |
void |
visitSelectClause(SelectClause node) |
protected void |
visitSimpleExpression(Column column,
Operator op,
Operand rvalue,
String cast,
int arrayElementIndex) |
void |
visitStringLiteral(String string) |
void |
visitStringLiteral(StringLiteral node) |
visitFromClause, visitGroupByClause, visitHavingClause, visitLiteral, visitOperandList, visitOrderByClause, visitReferenceList, visitWhereClause
public static final String PATH_SEP
public final LinkedList<Column> whatColumns
public final LinkedList<String> whatKeys
public final StringBuilder buf
protected int uniqueJoinIndex
protected int hierJoinCount
protected Map<String,Table> propertyHierTables
protected final boolean isProxies
protected boolean aliasOrderByColumns
protected boolean allowSubSelect
protected boolean inSelect
protected boolean inOrderBy
protected int ftJoinNumber
protected Dialect.FulltextMatchInfo ftMatchInfo
protected boolean visitingId
protected Map<String,Dialect.ArraySubQuery> propertyArraySubQueries
protected int arraySubQueryJoinCount
protected Map<String,Column> posColumns
protected List<Column> posColumnsInOrderBy
public WhereBuilder(boolean isProxies)
protected int getUniqueJoinIndex()
protected Dialect.ArraySubQuery getArraySubQuery(Table contextHier, String contextKey, Column arrayColumn, boolean skipJoin)
LEFT JOIN (SELECT id, UNNEST(somecol) AS item, generate_subscripts(somecol, 1) AS pos FROM someschema) _A1 ON _A1.id = hierarchy.id
protected NXQLQueryMaker.ColumnInfo getSpecialColumnInfo(String name)
public NXQLQueryMaker.ColumnInfo getColumnInfo(String name)
protected NXQLQueryMaker.ColumnInfo getRegularColumnInfo(String xpath)
Accumulates info about joins needed to get to this property.
IMPORTANT: THIS MUST NOT BE CALLED TWICE ON THE SAME PROPERTY as some structures are updated (joins, counters).
QueryParseException
- if the property doesn't existpublic void visitQuery(SQLQuery node)
visitQuery
in interface IVisitor
visitQuery
in class DefaultQueryVisitor
public void visitSelectClause(SelectClause node)
visitSelectClause
in interface IVisitor
visitSelectClause
in class DefaultQueryVisitor
public void visitMultiExpression(MultiExpression node)
visitMultiExpression
in interface IVisitor
visitMultiExpression
in class DefaultQueryVisitor
public void visitExpression(Expression node)
visitExpression
in interface IVisitor
visitExpression
in class DefaultQueryVisitor
protected Operand getBooleanLiteral(Operand rvalue)
protected void visitColumnExpression(Column column, Operator op, Operand rvalue, String cast, String lvalueName, int arrayElementIndex)
protected void visitSimpleExpression(Column column, Operator op, Operand rvalue, String cast, int arrayElementIndex)
protected void checkDateLiteralForCast(Operand value, Expression node)
protected void generateExistsStart(StringBuilder buf, Table table)
protected void generateExistsEnd(StringBuilder buf)
protected void visitExpressionStartsWith(Expression node)
protected void visitExpressionStartsWithPath(String path)
protected void visitExpressionStartsWithNonPath(Expression node, String path)
protected void visitExpressionEcmPath(Expression node)
protected void visitExpressionAncestorId(Expression node)
protected void visitExpressionIsProxy(Expression node)
protected void visitExpressionWhereFalseIsNull(Expression node)
protected void visitExpressionWhereFalseMayBeNull(Expression node)
protected void visitExpressionMixinType(Expression expr)
include: primarytype IN (... types with Foo or Bar ...) OR mixintypes LIKE '%Foo%' OR mixintypes LIKE '%Bar%'
exclude: primarytype IN (... types without Foo or Bar ...) AND (mixintypes NOT LIKE '%Foo%' AND mixintypes NOT LIKE '%Bar%' OR mixintypes IS NULL)
protected void visitExpressionFulltext(Expression node, String name)
protected void visitExpressionEqOrIn(Column column, Operator op, Operand rvalue, String cast, int arrayElementIndex)
protected void visitExpressionLike(Column column, Operator op, Operand rvalue, String lvalueName, int arrayElementIndex)
protected void visitExpressionIlike(Column column, Operator op, Operand rvalue, String lvalueName, int arrayElementIndex)
protected void addLikeEscaping()
public void visitOperator(Operator node)
visitOperator
in interface IVisitor
visitOperator
in class DefaultQueryVisitor
public void visitReference(Reference node)
visitReference
in interface IVisitor
visitReference
in class DefaultQueryVisitor
protected void visitReference(Column column)
protected void visitReference(Column column, String cast)
protected void visitReference(Column column, int arrayElementIndex)
protected void visitReference(Column column, String cast, int arrayElementIndex)
public void visitLiteralList(LiteralList node)
visitLiteralList
in interface IVisitor
visitLiteralList
in class DefaultQueryVisitor
public void visitDateLiteral(DateLiteral node)
visitDateLiteral
in interface IVisitor
visitDateLiteral
in class DefaultQueryVisitor
public void visitStringLiteral(StringLiteral node)
visitStringLiteral
in interface IVisitor
visitStringLiteral
in class DefaultQueryVisitor
public void visitStringLiteral(String string)
public void visitDoubleLiteral(DoubleLiteral node)
visitDoubleLiteral
in interface IVisitor
visitDoubleLiteral
in class DefaultQueryVisitor
public void visitIntegerLiteral(IntegerLiteral node)
visitIntegerLiteral
in interface IVisitor
visitIntegerLiteral
in class DefaultQueryVisitor
public void visitBooleanLiteral(BooleanLiteral node)
visitBooleanLiteral
in interface IVisitor
visitBooleanLiteral
in class DefaultQueryVisitor
public void visitFunction(Function node)
visitFunction
in interface IVisitor
visitFunction
in class DefaultQueryVisitor
protected void visitScore()
protected ColumnType getAggregateType(String func, ColumnType arg)
public void visitOrderByList(OrderByList node)
visitOrderByList
in interface IVisitor
visitOrderByList
in class DefaultQueryVisitor
public void visitOrderByPosColumns()
public void visitOrderByExpr(OrderByExpr node)
visitOrderByExpr
in interface IVisitor
visitOrderByExpr
in class DefaultQueryVisitor
Copyright © 2018 Nuxeo. All rights reserved.