Class NotImpl
- java.lang.Object
-
- org.apache.jackrabbit.oak.query.ast.ConstraintImpl
-
- org.apache.jackrabbit.oak.query.ast.NotImpl
-
public class NotImpl extends ConstraintImpl
A "not" condition.
-
-
Constructor Summary
Constructors Constructor Description NotImpl(ConstraintImpl constraint)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsUnfilteredFullTextCondition()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')".protected PropertyValueconvertValueToType(PropertyValue v, PropertyValue targetType)org.apache.jackrabbit.oak.query.ast.AstElementcopyOf()booleanevaluate()Evaluate the result using the currently set values.ConstraintImplgetConstraint()protected StringgetLocalPath(String path)Calculate the session local path (the path excluding the workspace name) if possible.Set<PropertyExistenceImpl>getPropertyExistenceConditions()Get the set of property existence conditions that can be derived for this condition.Set<SelectorImpl>getSelectors()Get the set of selectors for the given condition.protected StringnormalizePath(String path)Validate and normalize the path.protected StringnormalizePropertyName(String propertyName)Normalize the property name (including namespace remapping).protected Stringprotect(Object expression)protected static Stringquote(String pathOrName)protected static StringquoteJson(String string)booleanrequiresFullTextIndex()Whether the constraint contains a fulltext condition that requires using a fulltext index, because the condition can only be evaluated there.voidrestrict(FilterImpl f)Apply the condition to the filter, further restricting the filter if possible.voidrestrictPushDown(SelectorImpl s)Push as much of the condition down to this selector, further restricting the selector condition if possible.voidsetQuery(QueryImpl query)ConstraintImplsimplify()Apply DeMorgan's Laws to push AND/OR constraints higher.StringtoString()-
Methods inherited from class org.apache.jackrabbit.oak.query.ast.ConstraintImpl
convertToUnion, equals, evaluateStop, getFullTextConstraint, hashCode
-
-
-
-
Field Detail
-
query
protected QueryImpl query
-
-
Constructor Detail
-
NotImpl
public NotImpl(ConstraintImpl constraint)
-
-
Method Detail
-
getConstraint
public ConstraintImpl getConstraint()
-
simplify
public ConstraintImpl simplify()
Apply DeMorgan's Laws to push AND/OR constraints higher.- Overrides:
simplifyin classConstraintImpl- Returns:
- the simplified constraint, or "this" if it is not possible to simplify
-
evaluate
public boolean evaluate()
Description copied from class:ConstraintImplEvaluate the result using the currently set values.- Specified by:
evaluatein classConstraintImpl- Returns:
- true if the constraint matches
-
getPropertyExistenceConditions
public Set<PropertyExistenceImpl> getPropertyExistenceConditions()
Description copied from class:ConstraintImplGet the set of property existence conditions that can be derived for this condition. For example, for the condition "x=1 or x=2", the property existence condition is "x is not null". For the condition "x=1 or y=2", there is no such condition. For the condition "x=1 and y=1", there are two (x is not null, and y is not null).- Specified by:
getPropertyExistenceConditionsin classConstraintImpl- Returns:
- the common property existence condition (possibly empty)
-
getSelectors
public Set<SelectorImpl> getSelectors()
Description copied from class:ConstraintImplGet the set of selectors for the given condition.- Specified by:
getSelectorsin classConstraintImpl- Returns:
- the set of selectors (possibly empty)
-
restrict
public void restrict(FilterImpl f)
Description copied from class:ConstraintImplApply the condition to the filter, further restricting the filter if possible. This may also verify the data types are compatible, and that paths are valid.- Specified by:
restrictin classConstraintImpl- Parameters:
f- the filter
-
restrictPushDown
public void restrictPushDown(SelectorImpl s)
Description copied from class:ConstraintImplPush as much of the condition down to this selector, further restricting the selector condition if possible. This is important for a join: for example, the query "select * from a inner join b on a.x=b.x where a.y=1 and b.y=1", the condition "a.y=1" can be pushed down to "a", and the condition "b.y=1" can be pushed down to "b". That means it is possible to use an index in this case.- Specified by:
restrictPushDownin classConstraintImpl- Parameters:
s- the selector
-
copyOf
public org.apache.jackrabbit.oak.query.ast.AstElement copyOf()
- Returns:
- a clone of self. Default implementation in
AstElementreturns same reference tothis.
-
requiresFullTextIndex
public boolean requiresFullTextIndex()
Description copied from class:ConstraintImplWhether the constraint contains a fulltext condition that requires using a fulltext index, because the condition can only be evaluated there.- Overrides:
requiresFullTextIndexin classConstraintImpl- Returns:
- true if yes
-
containsUnfilteredFullTextCondition
public boolean containsUnfilteredFullTextCondition()
Description copied from class:ConstraintImplWhether 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')".- Overrides:
containsUnfilteredFullTextConditionin classConstraintImpl- Returns:
- true if yes
-
setQuery
public void setQuery(QueryImpl query)
-
normalizePropertyName
protected String normalizePropertyName(String propertyName)
Normalize the property name (including namespace remapping). Asterisks are kept.- Parameters:
propertyName- the property name to normalize- Returns:
- the normalized (oak-) property name
-
normalizePath
protected String normalizePath(String path)
Validate and normalize the path.- Parameters:
path- the path to validate- Returns:
- the validated and normalized path
-
convertValueToType
protected PropertyValue convertValueToType(PropertyValue v, PropertyValue targetType)
-
-