T
- type
identifying the Repositories
to match on during registration.QUERY
- type
of the query to process.@FunctionalInterface public interface QueryPostProcessor<T extends Repository,QUERY> extends Ordered
QueryPostProcessor
interface defines a contract for implementations to post process
a given query
and possibly return a new or modified version of the same query
.
QueryPostProcessors
are useful for handling and processing queries
derived from Repository
QueryMethods
, and give a developer the opportunity,
via the callback, to further process the generated query
.
QueryPostProcessors
can be used on both derived queries
and manual queries
. Manual queries
are defined as
queries
specified using SDG's @Query
annotation or by defining a named
query
in a module-specific Properties
files
(e.g. META-INF/gemfire-named-queries.properties).FunctionalInterface
,
Ordered
,
Query
,
Repository
,
NamedQueries
,
QueryMethod
Modifier and Type | Field and Description |
---|---|
static Object[] |
EMPTY_ARGUMENTS |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Modifier and Type | Method and Description |
---|---|
default int |
getOrder()
|
default QUERY |
postProcess(QueryMethod queryMethod,
QUERY query)
Callback method invoked by the Spring Data (SD)
Repository framework to allow the user to process
the given query and (possibly) return a new or modified version of the query . |
QUERY |
postProcess(QueryMethod queryMethod,
QUERY query,
Object... arguments)
Callback method invoked by the Spring Data (SD)
Repository framework to allow the user to process
the given query and (possibly) return a new or modified version of the query . |
default QueryPostProcessor<T,QUERY> |
processAfter(QueryPostProcessor<T,QUERY> queryPostProcessor)
Builder method used to compose this
QueryPostProcessors
with the given QueryPostProcessor . |
default QueryPostProcessor<T,QUERY> |
processBefore(QueryPostProcessor<T,QUERY> queryPostProcessor)
Builder method used to compose this
QueryPostProcessor
with the given QueryPostProcessor . |
static final Object[] EMPTY_ARGUMENTS
default int getOrder()
order
of this QueryPostProcessor
relative to
other QueryPostProcessors
in a sort.
Defaults to the Ordered.LOWEST_PRECEDENCE
.getOrder
in interface Ordered
Integer
value specifying the order of this QueryPostProcessor
relative to
other QueryPostProcessors
in a sort.Ordered.getOrder()
default QUERY postProcess(@NonNull QueryMethod queryMethod, QUERY query)
Repository
framework to allow the user to process
the given query
and (possibly) return a new or modified version of the query
.
This callback is invoked for queries generated from a SD Repository
QueryMethod
signature as well as queries specified and defined in NamedQueries
,
or even using SDG's @Query
annotation.query
- query
to process.query
.QueryMethod
,
postProcess(QueryMethod, Object, Object...)
QUERY postProcess(@NonNull QueryMethod queryMethod, QUERY query, Object... arguments)
Repository
framework to allow the user to process
the given query
and (possibly) return a new or modified version of the query
.
This callback is invoked for queries generated from a SD Repository
QueryMethod
signature as well as queries specified and defined in NamedQueries
,
or even using SDG's @Query
annotation.query
- query
to process.arguments
- array of Objects
containing the arguments to the query parameters.query
.QueryMethod
,
postProcess(QueryMethod, Object)
@NonNull default QueryPostProcessor<T,QUERY> processBefore(@Nullable QueryPostProcessor<T,QUERY> queryPostProcessor)
QueryPostProcessor
with the given QueryPostProcessor
.
This QueryPostProcessor
will process the query before the given QueryPostProcessor
in the processing chain.queryPostProcessor
- QueryPostProcessor
to compose with this QueryPostProcessor
.QueryPostProcessor
consisting of this QueryPostProcessor
followed by the given QueryPostProcessor
. Returns this QueryPostProcessor
if the given QueryPostProcessor
is null.processAfter(QueryPostProcessor)
@NonNull default QueryPostProcessor<T,QUERY> processAfter(@Nullable QueryPostProcessor<T,QUERY> queryPostProcessor)
QueryPostProcessors
with the given QueryPostProcessor
.
This QueryPostProcessor
will process the query after the given QueryPostProcessor
in the processing chain.queryPostProcessor
- QueryPostProcessor
to compose with this QueryPostProcessor
.QueryPostProcessor
consisting of the given QueryPostProcessor
followed by this QueryPostProcessor
. Returns this QueryPostProcessor
if the given QueryPostProcessor
is null.processBefore(QueryPostProcessor)
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.