Package org.apache.jackrabbit.oak.api
Interface QueryEngine
-
@ProviderType public interface QueryEngine
The query engine allows to parse and execute queries.What query languages are supported depends on the registered query parsers.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INTERNAL_SQL2_QUERY
The suffix for internal SQL-2 statements.static java.util.Map<java.lang.String,PropertyValue>
NO_BINDINGS
Empty set of variables bindings.static java.util.Map<java.lang.String,java.lang.String>
NO_MAPPINGS
Empty set of namespace prefix mappings.
-
Method Summary
All Methods Instance Methods Abstract 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.java.util.Set<java.lang.String>
getSupportedQueryLanguages()
Get the set of supported query languages.
-
-
-
Field Detail
-
INTERNAL_SQL2_QUERY
static final java.lang.String INTERNAL_SQL2_QUERY
The suffix for internal SQL-2 statements. Those are logged with trace level instead of debug level.- See Also:
- Constant Field Values
-
NO_BINDINGS
static final java.util.Map<java.lang.String,PropertyValue> NO_BINDINGS
Empty set of variables bindings. Useful as an argument toexecuteQuery(String, String, long, long, Map, Map)
when there are no variables in a query.
-
NO_MAPPINGS
static final java.util.Map<java.lang.String,java.lang.String> NO_MAPPINGS
Empty set of namespace prefix mappings. Useful as an argument togetBindVariableNames(String, String, Map)
andexecuteQuery(String, String, long, long, Map, Map)
when there are no local namespace mappings.
-
-
Method Detail
-
getSupportedQueryLanguages
java.util.Set<java.lang.String> getSupportedQueryLanguages()
Get the set of supported query languages.- Returns:
- the supported query languages
-
getBindVariableNames
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.- Parameters:
statement
- query statementlanguage
- query languagemappings
- namespace prefix mappings- Returns:
- the list of bind variable names
- Throws:
java.text.ParseException
-
executeQuery
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
Execute a query and get the result.- 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 parsedjava.lang.IllegalArgumentException
- if there was an error executing the query
-
executeQuery
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
Execute a query and get the result.- 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 parsedjava.lang.IllegalArgumentException
- if there was an error executing the query
-
executeQuery
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
Execute a query and get the result. This is a convenience method: no limit, and offset 0.- 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 parsedjava.lang.IllegalArgumentException
- if there was an error executing the query
-
-