public abstract class ConstraintImpl
extends java.lang.Object
Constructor and Description |
---|
ConstraintImpl() |
Modifier and Type | Method and Description |
---|---|
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')".
|
@NotNull 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) |
@NotNull org.apache.jackrabbit.oak.query.ast.AstElement |
copyOf() |
boolean |
equals(java.lang.Object other) |
abstract boolean |
evaluate()
Evaluate the result using the currently set values.
|
boolean |
evaluateStop()
Whether this condition will, from now on, always evaluate to false.
|
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.
|
abstract java.util.Set<PropertyExistenceImpl> |
getPropertyExistenceConditions()
Get the set of property existence conditions that can be derived for this
condition.
|
abstract 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) |
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.
|
abstract void |
restrict(FilterImpl f)
Apply the condition to the filter, further restricting the filter if
possible.
|
abstract 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.
|
protected QueryImpl query
public ConstraintImpl simplify()
public abstract boolean evaluate()
public boolean evaluateStop()
"WHERE ROWNUM < 10"
in Oracle.public abstract java.util.Set<PropertyExistenceImpl> getPropertyExistenceConditions()
public FullTextExpression getFullTextConstraint(SelectorImpl s)
s
- the selectorpublic abstract java.util.Set<SelectorImpl> getSelectors()
public abstract void restrict(FilterImpl f)
f
- the filterpublic abstract void restrictPushDown(SelectorImpl s)
s
- the selectorpublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean requiresFullTextIndex()
public boolean containsUnfilteredFullTextCondition()
@NotNull public @NotNull java.util.Set<ConstraintImpl> convertToUnion()
[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 convertToUnion()
always return an empty set.
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 path@NotNull public @NotNull org.apache.jackrabbit.oak.query.ast.AstElement copyOf()
AstElement
returns same reference
to this
.Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.