public interface IAdornmentProvider
A default implementation is available in AllValidAdornments that describes all
adornments fulfilling the parameter direction declarations;
another default option (with better performance but restricted applicability) is LazyPlanningAdornments.
Users may implement this interface to limit the number of prepared plans based on some runtime information:
class SomeAdornments{
public Iterable<Set<PParameter>> getAdornments(PQuery query){
if (SomeGeneratedQuerySpecification.instance().getInternalQueryRepresentation().equals(query)){
return Collections.singleton(Sets.filter(Sets.newHashSet(query.getParameters()), new Predicate() {
@Override
public boolean apply(PParameter input) {
// Decide whether this particular parameter will be bound
return false;
}
}));
}
// Returning an empty iterable is safe for unknown queries
return Collections.emptySet();
}
}
| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<java.util.Set<PParameter>> |
getAdornments(PQuery query)
The bound parameter sets
|
static QueryEvaluationHint |
toHint(IAdornmentProvider adornmentProvider) |
java.lang.Iterable<java.util.Set<PParameter>> getAdornments(PQuery query)
static QueryEvaluationHint toHint(IAdornmentProvider adornmentProvider)