@Retention(value=RUNTIME) @Target(value=METHOD) protected static @interface QueryRewriter.Rewrite
This annotation must be applied to a public method which returns
Predicate
. The arguments of the method should Predicate
, or
any subclass of it. The annotation value is a query language string which
describes the subtree this rewrite applies to. Method arguments should be
named with a Named
annotation, and the same names should be used in
the query.
For example:
@Rewrite("A=(owner:*) B=(status:*)") public Predicate ownerStatus(@Named("A") OperatorPredicate owner, @Named("B") OperatorPredicate status) { }matches an AND Predicate with at least two children, one being an operator predicate called "owner" and the other being an operator predicate called "status". The variables in the query are matched by name against the parameters.
public abstract String value