public class JoinImpl extends SourceImpl
Constructor and Description |
---|
JoinImpl(SourceImpl left,
SourceImpl right,
JoinType joinType,
JoinConditionImpl joinCondition) |
Modifier and Type | Method and Description |
---|---|
void |
addJoinCondition(JoinConditionImpl joinCondition,
boolean forThisSelector)
Add the join condition (the ON ...
|
protected PropertyValue |
convertValueToType(PropertyValue v,
PropertyValue targetType) |
org.apache.jackrabbit.oak.query.ast.AstElement |
copyOf() |
Filter |
createFilter(boolean preparing)
!Test purpose only!
this creates a filter for the given query
|
void |
execute(NodeState rootState)
Execute the query.
|
java.lang.String |
getIndexCostInfo(NodeState rootState)
Get the index cost as a JSON string.
|
java.util.List<JoinConditionImpl> |
getInnerJoinConditions()
Get the list of inner join conditions.
|
java.util.ArrayList<SourceImpl> |
getInnerJoinSelectors()
Get all sources that are joined via inner join.
|
JoinConditionImpl |
getJoinCondition() |
SourceImpl |
getLeft() |
protected java.lang.String |
getLocalPath(java.lang.String path)
Calculate the session local path (the path excluding the workspace name)
if possible.
|
java.lang.String |
getPlan(NodeState rootState)
Get the query plan.
|
SourceImpl |
getRight() |
SelectorImpl |
getSelector(java.lang.String selectorName)
Get the selector with the given name, or null if not found.
|
long |
getSize(NodeState rootState,
Result.SizePrecision precision,
long max)
Get the size if known.
|
boolean |
isOuterJoinRightHandSide()
Whether any selector is the outer-join right hand side.
|
boolean |
next()
Go to the next node for the given source.
|
protected java.lang.String |
normalizePath(java.lang.String path)
Validate and normalize the path.
|
protected java.lang.String |
normalizePropertyName(java.lang.String propertyName)
Normalize the property name (including namespace remapping).
|
ExecutionPlan |
prepare()
Prepare executing the query (recursively).
|
void |
prepare(ExecutionPlan p)
Re-apply a previously prepared plan.
|
protected java.lang.String |
protect(java.lang.Object expression) |
protected java.lang.String |
quote(java.lang.String pathOrName) |
protected java.lang.String |
quoteJson(java.lang.String string) |
void |
setOuterJoin(boolean outerJoinLeftHandSide,
boolean outerJoinRightHandSide)
Set whether this source is the left hand side or right hand side of a left outer join.
|
void |
setQuery(QueryImpl query) |
void |
setQueryConstraint(ConstraintImpl queryConstraint)
Set the complete constraint of the query (the WHERE ...
|
java.lang.String |
toString() |
void |
unprepare()
Undo a prepare.
|
getExistingSelector
protected QueryImpl query
public JoinImpl(SourceImpl left, SourceImpl right, JoinType joinType, JoinConditionImpl joinCondition)
public java.util.ArrayList<SourceImpl> getInnerJoinSelectors()
SourceImpl
getInnerJoinSelectors
in class SourceImpl
public java.util.List<JoinConditionImpl> getInnerJoinConditions()
SourceImpl
getInnerJoinConditions
in class SourceImpl
public JoinConditionImpl getJoinCondition()
public SourceImpl getLeft()
public SourceImpl getRight()
public java.lang.String getPlan(NodeState rootState)
SourceImpl
getPlan
in class SourceImpl
rootState
- the rootpublic java.lang.String getIndexCostInfo(NodeState rootState)
SourceImpl
getIndexCostInfo
in class SourceImpl
rootState
- the rootpublic java.lang.String toString()
toString
in class java.lang.Object
public void unprepare()
SourceImpl
unprepare
in class SourceImpl
public void prepare(ExecutionPlan p)
SourceImpl
prepare
in class SourceImpl
p
- the plan to usepublic ExecutionPlan prepare()
SourceImpl
prepare
in class SourceImpl
public SelectorImpl getSelector(java.lang.String selectorName)
SourceImpl
getSelector
in class SourceImpl
selectorName
- the selector namepublic void execute(NodeState rootState)
SourceImpl
execute
in class SourceImpl
rootState
- root state of the given revisionpublic Filter createFilter(boolean preparing)
SourceImpl
createFilter
in class SourceImpl
preparing
- whether this this the prepare phasepublic void setQueryConstraint(ConstraintImpl queryConstraint)
SourceImpl
setQueryConstraint
in class SourceImpl
queryConstraint
- the constraintpublic void setOuterJoin(boolean outerJoinLeftHandSide, boolean outerJoinRightHandSide)
SourceImpl
setOuterJoin
in class SourceImpl
outerJoinLeftHandSide
- true if yesouterJoinRightHandSide
- true if yespublic void addJoinCondition(JoinConditionImpl joinCondition, boolean forThisSelector)
SourceImpl
addJoinCondition
in class SourceImpl
joinCondition
- the join conditionforThisSelector
- if set, the join condition can only be evaluated
when all previous selectors are executed.public boolean next()
SourceImpl
next
in class SourceImpl
public boolean isOuterJoinRightHandSide()
SourceImpl
isOuterJoinRightHandSide
in class SourceImpl
public long getSize(NodeState rootState, Result.SizePrecision precision, long max)
SourceImpl
getSize
in class SourceImpl
rootState
- the root node state (to initialize the cursor, if needed)precision
- the required precisionmax
- the maximum nodes read (for an exact size)public org.apache.jackrabbit.oak.query.ast.AstElement copyOf()
AstElement
returns same reference
to this
.protected java.lang.String protect(java.lang.Object expression)
protected java.lang.String quote(java.lang.String pathOrName)
protected java.lang.String quoteJson(java.lang.String string)
public void setQuery(QueryImpl query)
protected java.lang.String normalizePropertyName(java.lang.String propertyName)
propertyName
- the property name to normalizeprotected java.lang.String normalizePath(java.lang.String path)
path
- the path to validateprotected PropertyValue convertValueToType(PropertyValue v, PropertyValue targetType)
protected java.lang.String getLocalPath(java.lang.String path)
path
- the absolute pathCopyright © 2012–2022 The Apache Software Foundation. All rights reserved.