public class AndImpl extends ConstraintImpl
Constructor and Description |
---|
AndImpl(ConstraintImpl constraint1,
ConstraintImpl constraint2) |
AndImpl(java.util.List<ConstraintImpl> constraints) |
Modifier and Type | Method and Description |
---|---|
void |
addToUnionList(java.util.Set<ConstraintImpl> target) |
boolean |
containsUnfilteredFullTextCondition()
Whether the condition contains a fulltext condition that can not be
applied to the filter, for example because it is part of an "or" condition
of the form "where a=1 or contains(., 'x')".
|
java.util.Set<ConstraintImpl> |
convertToUnion()
Compute a set of sub-constraints that could be used for composing UNION
statements.
|
protected PropertyValue |
convertValueToType(PropertyValue v,
PropertyValue targetType) |
org.apache.jackrabbit.oak.query.ast.AstElement |
copyOf() |
boolean |
equals(java.lang.Object that) |
boolean |
evaluate()
Evaluate the result using the currently set values.
|
boolean |
evaluateStop()
Whether this condition will, from now on, always evaluate to false.
|
java.util.List<ConstraintImpl> |
getConstraints() |
FullTextExpression |
getFullTextConstraint(SelectorImpl s)
Get the (combined) full-text constraint.
|
protected java.lang.String |
getLocalPath(java.lang.String path)
Calculate the session local path (the path excluding the workspace name)
if possible.
|
java.util.Set<PropertyExistenceImpl> |
getPropertyExistenceConditions()
Get the set of property existence conditions that can be derived for this
condition.
|
java.util.Set<SelectorImpl> |
getSelectors()
Get the set of selectors for the given condition.
|
int |
hashCode() |
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).
|
protected java.lang.String |
protect(java.lang.Object expression) |
AndImpl |
pullOrRight() |
protected java.lang.String |
quote(java.lang.String pathOrName) |
protected java.lang.String |
quoteJson(java.lang.String string) |
boolean |
requiresFullTextIndex()
Whether the constraint contains a fulltext condition that requires
using a fulltext index, because the condition can only be evaluated there.
|
void |
restrict(FilterImpl f)
Apply the condition to the filter, further restricting the filter if
possible.
|
void |
restrictPushDown(SelectorImpl s)
Push as much of the condition down to this selector, further restricting
the selector condition if possible.
|
void |
setQuery(QueryImpl query) |
ConstraintImpl |
simplify()
Simplify the expression if possible, for example by removing duplicate expressions.
|
java.lang.String |
toString() |
protected QueryImpl query
public AndImpl(java.util.List<ConstraintImpl> constraints)
public AndImpl(ConstraintImpl constraint1, ConstraintImpl constraint2)
public java.util.List<ConstraintImpl> getConstraints()
public ConstraintImpl simplify()
ConstraintImpl
simplify
in class ConstraintImpl
public java.util.Set<PropertyExistenceImpl> getPropertyExistenceConditions()
ConstraintImpl
getPropertyExistenceConditions
in class ConstraintImpl
public FullTextExpression getFullTextConstraint(SelectorImpl s)
ConstraintImpl
getFullTextConstraint
in class ConstraintImpl
s
- the selectorpublic java.util.Set<SelectorImpl> getSelectors()
ConstraintImpl
getSelectors
in class ConstraintImpl
public boolean evaluate()
ConstraintImpl
evaluate
in class ConstraintImpl
public boolean evaluateStop()
ConstraintImpl
"WHERE ROWNUM < 10"
in Oracle.evaluateStop
in class ConstraintImpl
public void restrict(FilterImpl f)
ConstraintImpl
restrict
in class ConstraintImpl
f
- the filterpublic void restrictPushDown(SelectorImpl s)
ConstraintImpl
restrictPushDown
in class ConstraintImpl
s
- the selectorpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object that)
equals
in class ConstraintImpl
public int hashCode()
hashCode
in class ConstraintImpl
public org.apache.jackrabbit.oak.query.ast.AstElement copyOf()
AstElement
returns same reference
to this
.public void addToUnionList(java.util.Set<ConstraintImpl> target)
public AndImpl pullOrRight()
public java.util.Set<ConstraintImpl> convertToUnion()
ConstraintImpl
[c=1, c=2]
. Those can be later on used for re-composing
conditions.
If it is not possible to convert to a union, it must return an empty set.
The default implementation in ConstraintImpl.convertToUnion()
always return an empty set.
convertToUnion
in class ConstraintImpl
public boolean requiresFullTextIndex()
ConstraintImpl
requiresFullTextIndex
in class ConstraintImpl
public boolean containsUnfilteredFullTextCondition()
ConstraintImpl
containsUnfilteredFullTextCondition
in class ConstraintImpl
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.