Package cz.cvut.kbss.jopa.model
Class QueryHintsHandler
java.lang.Object
cz.cvut.kbss.jopa.model.QueryHintsHandler
Processes query hints.
To add a new hint (inspired by Eclipselink):
- Define a hint in
QueryHints
- Ad an inner class extending
QueryHintsHandler.Hint
corresponding to the new hint. The class should implement theQueryHintsHandler.Hint.applyToQuery(Object, AbstractQuery, Statement)
method and provide an array of values for transformation. - Register the new hint class by calling
QueryHintsHandler.Hint.registerHint(Hint)
with an instance of the hint
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Allows disabling inference for query execution.protected static class
-
Method Summary
-
Method Details
-
getSupportedHints
Gets query hints supported by this implementation.- Returns:
- A set of query hint names
-
apply
public static void apply(String hintName, Object hintValue, cz.cvut.kbss.jopa.model.AbstractQuery query, Statement statement) Applies the specified hint value to the specified query.Note that if the hint is unknown, it is ignored.
- Parameters:
hintName
- Query hint namehintValue
- Query hint valuequery
- Query to apply the hint value tostatement
- OntoDriver statement that will be used to execute the specified query. The hint value may be applied directly to it- Throws:
IllegalArgumentException
- If the hint value is not supported
-