protected class NXQLQueryMaker.QueryAnalyzer extends DefaultQueryVisitor
Predicate
s of the WHERE clause
into a single MultiExpression
for easier analysis.Modifier and Type | Field and Description |
---|---|
protected FacetFilter |
facetFilter |
protected int |
ftCount |
protected boolean |
hasSelectCollection
Do we have a SELECT somelist/* FROM ...
|
protected boolean |
hasWildcardIndex |
protected boolean |
inOrderBy |
protected boolean |
inSelect |
protected boolean |
onlyRelations
Do we match only relations (and therefore no proxies).
|
protected List<String> |
orderByColumnNames |
protected boolean |
orderByHasWildcardIndex |
protected boolean |
orderByScore |
protected boolean |
selectScore |
protected LinkedList<Operand> |
toplevelOperands |
protected List<String> |
whatColumnNames |
protected MultiExpression |
wherePredicate |
Constructor and Description |
---|
QueryAnalyzer(FacetFilter facetFilter) |
Modifier and Type | Method and Description |
---|---|
void |
addFacetFilterClauses(FacetFilter facetFilter) |
protected void |
analyzeToplevelIsProxy(Expression expr) |
protected void |
analyzeToplevelOperands(Operand node)
Process special toplevel ANDed operands: ecm:isProxy
|
protected void |
analyzeToplevelProxyProperty(Expression expr) |
protected void |
checkProperty(String xpath)
Checks that a property exists.
|
protected void |
init() |
protected void |
simplifyToplevelOperands()
Simplify ecm:primaryType positive references, and non-per-instance mixin types.
|
void |
visitExpression(Expression node) |
protected void |
visitExpressionFulltext(Expression node,
String name) |
void |
visitFromClause(FromClause node)
Finds all the types to take into account (all concrete types being a subtype of the passed types) based on
the FROM list.
|
void |
visitFunction(Function node) |
void |
visitOrderByClause(OrderByClause node) |
void |
visitQuery(SQLQuery node) |
void |
visitReference(Reference node) |
void |
visitSelectClause(SelectClause node) |
void |
visitWhereClause(WhereClause node) |
visitBooleanLiteral, visitDateLiteral, visitDoubleLiteral, visitGroupByClause, visitHavingClause, visitIntegerLiteral, visitLiteral, visitLiteralList, visitMultiExpression, visitOperandList, visitOperator, visitOrderByExpr, visitOrderByList, visitReferenceList, visitStringLiteral
protected FacetFilter facetFilter
protected boolean inSelect
protected boolean inOrderBy
protected LinkedList<Operand> toplevelOperands
protected MultiExpression wherePredicate
protected boolean onlyRelations
protected List<String> whatColumnNames
protected List<String> orderByColumnNames
protected boolean hasSelectCollection
protected boolean hasWildcardIndex
protected boolean orderByHasWildcardIndex
protected int ftCount
protected boolean selectScore
protected boolean orderByScore
public QueryAnalyzer(FacetFilter facetFilter)
protected void init()
public void visitQuery(SQLQuery node)
visitQuery
in interface IVisitor
visitQuery
in class DefaultQueryVisitor
public void addFacetFilterClauses(FacetFilter facetFilter)
public void visitSelectClause(SelectClause node)
visitSelectClause
in interface IVisitor
visitSelectClause
in class DefaultQueryVisitor
public void visitFromClause(FromClause node)
Adds them as a ecm:primaryType match in the toplevel operands.
visitFromClause
in interface IVisitor
visitFromClause
in class DefaultQueryVisitor
public void visitWhereClause(WhereClause node)
visitWhereClause
in interface IVisitor
visitWhereClause
in class DefaultQueryVisitor
protected void analyzeToplevelOperands(Operand node)
protected void simplifyToplevelOperands()
protected void analyzeToplevelIsProxy(Expression expr)
protected void analyzeToplevelProxyProperty(Expression expr)
public void visitExpression(Expression node)
visitExpression
in interface IVisitor
visitExpression
in class DefaultQueryVisitor
protected void visitExpressionFulltext(Expression node, String name)
public void visitReference(Reference node)
visitReference
in interface IVisitor
visitReference
in class DefaultQueryVisitor
protected void checkProperty(String xpath)
QueryParseException
- if the property doesn't existpublic void visitFunction(Function node)
visitFunction
in interface IVisitor
visitFunction
in class DefaultQueryVisitor
public void visitOrderByClause(OrderByClause node)
visitOrderByClause
in interface IVisitor
visitOrderByClause
in class DefaultQueryVisitor
Copyright © 2016 Nuxeo SA. All rights reserved.