Interface OqlQueryExecutor
- All Known Implementing Classes:
TemplateBasedOqlQueryExecutor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A Strategy interface for executing Apache Geode OQL queries (e.g. SELECT statements).
- Since:
- 2.4.0
- See Also:
-
SelectResults
QueryMethod
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.geode.cache.query.SelectResults
execute
(org.springframework.data.repository.query.QueryMethod queryMethod, String query, Object... arguments) Executes the givenOQL query
.Constructs a new instance ofUnsupportedQueryExecutionException
initialized with a canned message containing the given OQL query that could not be executed by theOqlQueryExecutor
implementation.default OqlQueryExecutor
thenExecuteWith
(OqlQueryExecutor queryExecutor) Null-safe composition method to compose thisOqlQueryExecutor
with the givenOqlQueryExecutor
.
-
Field Details
-
NON_EXECUTABLE_QUERY_MESSAGE
- See Also:
-
-
Method Details
-
execute
org.apache.geode.cache.query.SelectResults execute(org.springframework.data.repository.query.QueryMethod queryMethod, String query, Object... arguments) Executes the givenOQL query
.- Parameters:
queryMethod
-QueryMethod
modeling the OQl query.query
-String
containing the Apache Geode OQL query.arguments
- array ofarguments
used for the bind in OQL query parameters.- Returns:
- the
OQL query result set
. - Throws:
UnsupportedQueryExecutionException
- if thisOqlQueryExecutor
cannot execute (i.e. handle) the OQL query.- See Also:
-
QueryMethod
SelectResults
-
newUnsupportedQueryExecutionException
Constructs a new instance ofUnsupportedQueryExecutionException
initialized with a canned message containing the given OQL query that could not be executed by theOqlQueryExecutor
implementation.- Parameters:
query
-OQL query
that could not be executed.- Returns:
- a new
UnsupportedQueryExecutionException
. - See Also:
-
thenExecuteWith
Null-safe composition method to compose thisOqlQueryExecutor
with the givenOqlQueryExecutor
.OqlQueryExecutor
implementations should be composed in an order that is most suitable to the execution of the OQL query first. Meaning, the outer mostOqlQueryExecutor
should be the most suitableOqlQueryExecutor
to execute the given OQL query followed by the next most suitableOqlQueryExecutor
in the composition (i.e. chain) and so on until the OQL query is either successfully executed (handled) or the composition is exhausted, in which case, anException
could be thrown. If anis unable to execute, or handle, the given OQL query, then it must throw an {@link UnsupportedQueryExecutionException } to triggger the next {@link OqlQueryExecutor} in the composition.
- Parameters:
queryExecutor
-OqlQueryExecutor
to compose with thisOqlQueryExecutor
; must not be null.- Returns:
- a composed
OqlQueryExecutor
consisting of thisOqlQueryExecutor
composed with the givenOqlQueryExecutor
. If theOqlQueryExecutor
is null, then this method returns thisOqlQueryExecutor
. - See Also:
-