Package org.apache.cayenne
Interface DataChannelQueryFilter
- All Known Subinterfaces:
DataChannelFilter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An interface of a filter that allows to intercept DataChannel query operations.
Query filters allow to implement chains of custom processors around a DataChannel.
Example:
public class MyQueryFilter implements DataChannelQueryFilter {
public QueryResponse onQuery(ObjectContext originatingContext, Query query,
DataChannelQueryFilterChain filterChain) {
System.out.println("Do something before query");
// process query or return some custom response
QueryResponse response = filterChain.onQuery(originatingContext, query);
System.out.println("Do something after query");
return response;
}
}
- Since:
- 4.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiononQuery
(ObjectContext originatingContext, Query query, DataChannelQueryFilterChain filterChain)
-
Method Details
-
onQuery
QueryResponse onQuery(ObjectContext originatingContext, Query query, DataChannelQueryFilterChain filterChain) - Parameters:
originatingContext
- originating context of queryquery
- that is processedfilterChain
- chain of query filters to invoke after this filter- Returns:
- query response
-