Package org.apache.jackrabbit.oak.query
Class QueryEngineImpl
- java.lang.Object
-
- org.apache.jackrabbit.oak.query.QueryEngineImpl
-
- All Implemented Interfaces:
QueryEngine
public abstract class QueryEngineImpl extends java.lang.Object implements QueryEngine
The query engine implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueryEngineImpl.QuerySelectionMode
Used to instruct theQueryEngineImpl
on how to act with respect of the SQL2 optimisation.
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.api.QueryEngine
INTERNAL_SQL2_QUERY, NO_BINDINGS, NO_MAPPINGS
-
-
Constructor Summary
Constructors Constructor Description QueryEngineImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Result
executeQuery(java.lang.String statement, java.lang.String language, long limit, long offset, java.util.Map<java.lang.String,? extends PropertyValue> bindings, java.util.Map<java.lang.String,java.lang.String> mappings)
Execute a query and get the result.Result
executeQuery(java.lang.String statement, java.lang.String language, java.util.Map<java.lang.String,? extends PropertyValue> bindings, java.util.Map<java.lang.String,java.lang.String> mappings)
Execute a query and get the result.Result
executeQuery(java.lang.String statement, java.lang.String language, java.util.Optional<java.lang.Long> limit, java.util.Optional<java.lang.Long> offset, java.util.Map<java.lang.String,? extends PropertyValue> bindings, java.util.Map<java.lang.String,java.lang.String> mappings)
Execute a query and get the result.java.util.List<java.lang.String>
getBindVariableNames(java.lang.String statement, java.lang.String language, java.util.Map<java.lang.String,java.lang.String> mappings)
Parse the query (check if it's valid) and get the list of bind variable names.protected abstract ExecutionContext
getExecutionContext()
Get the execution context for a single query execution.java.util.Set<java.lang.String>
getSupportedQueryLanguages()
Get the set of supported query languages.protected void
setQuerySelectionMode(@NotNull QueryEngineImpl.QuerySelectionMode querySelectionMode)
Instruct the query engine on how to behave with regards to the SQL2 optimised query if available.protected void
setTraversalEnabled(boolean traversalEnabled)
-
-
-
Method Detail
-
getExecutionContext
protected abstract ExecutionContext getExecutionContext()
Get the execution context for a single query execution.- Returns:
- the context
-
getSupportedQueryLanguages
public java.util.Set<java.lang.String> getSupportedQueryLanguages()
Description copied from interface:QueryEngine
Get the set of supported query languages.- Specified by:
getSupportedQueryLanguages
in interfaceQueryEngine
- Returns:
- the supported query languages
-
getBindVariableNames
public java.util.List<java.lang.String> getBindVariableNames(java.lang.String statement, java.lang.String language, java.util.Map<java.lang.String,java.lang.String> mappings) throws java.text.ParseException
Parse the query (check if it's valid) and get the list of bind variable names.- Specified by:
getBindVariableNames
in interfaceQueryEngine
- Parameters:
statement
- query statementlanguage
- query languagemappings
- namespace prefix mappings- Returns:
- the list of bind variable names
- Throws:
java.text.ParseException
-
executeQuery
public Result executeQuery(java.lang.String statement, java.lang.String language, java.util.Map<java.lang.String,? extends PropertyValue> bindings, java.util.Map<java.lang.String,java.lang.String> mappings) throws java.text.ParseException
Description copied from interface:QueryEngine
Execute a query and get the result. This is a convenience method: no limit, and offset 0.- Specified by:
executeQuery
in interfaceQueryEngine
- Parameters:
statement
- the query statementlanguage
- the languagebindings
- the bind variable value bindingsmappings
- namespace prefix mappings- Returns:
- the result
- Throws:
java.text.ParseException
- if the statement could not be parsed
-
executeQuery
public Result executeQuery(java.lang.String statement, java.lang.String language, java.util.Optional<java.lang.Long> limit, java.util.Optional<java.lang.Long> offset, java.util.Map<java.lang.String,? extends PropertyValue> bindings, java.util.Map<java.lang.String,java.lang.String> mappings) throws java.text.ParseException
Description copied from interface:QueryEngine
Execute a query and get the result.- Specified by:
executeQuery
in interfaceQueryEngine
- Parameters:
statement
- the query statementlanguage
- the languagelimit
- the maximum result set size (may not be negative but may be empty)offset
- the number of rows to skip (may not be negative but may be empty)bindings
- the bind variable value bindingsmappings
- namespace prefix mappings- Returns:
- the result
- Throws:
java.text.ParseException
- if the statement could not be parsed
-
executeQuery
public Result executeQuery(java.lang.String statement, java.lang.String language, long limit, long offset, java.util.Map<java.lang.String,? extends PropertyValue> bindings, java.util.Map<java.lang.String,java.lang.String> mappings) throws java.text.ParseException
Description copied from interface:QueryEngine
Execute a query and get the result.- Specified by:
executeQuery
in interfaceQueryEngine
- Parameters:
statement
- the query statementlanguage
- the languagelimit
- the maximum result set size (may not be negative)offset
- the number of rows to skip (may not be negative)bindings
- the bind variable value bindingsmappings
- namespace prefix mappings- Returns:
- the result
- Throws:
java.text.ParseException
- if the statement could not be parsed
-
setTraversalEnabled
protected void setTraversalEnabled(boolean traversalEnabled)
-
setQuerySelectionMode
protected void setQuerySelectionMode(@NotNull @NotNull QueryEngineImpl.QuerySelectionMode querySelectionMode)
Instruct the query engine on how to behave with regards to the SQL2 optimised query if available.- Parameters:
querySelectionMode
- cannot be null
-
-