Module org.eclipse.persistence.jpa
Class QueryHintsHandler
java.lang.Object
org.eclipse.persistence.internal.jpa.QueryHintsHandler
The class processes query hints.
EclipseLink query hints and their values defined in org.eclipse.persistence.config package.
To add a new query hint:
Define a new hint in QueryHints;
Add a class containing hint's values if required to config package (like CacheUsage);
Alternatively values defined in HintValues may be used - Refresh and BindParameters hints do that.
Add an inner class to this class extending Hint corresponding to the new hint (like CacheUsageHint);
The first constructor parameter is hint name; the second is default value;
In constructor
provide 2-dimensional value array in case the values should be translated (currently all Hint classes do that);
in case translation is not required provide a single-dimension array (no such examples yet).
In inner class Hint static initializer addHint an instance of the new hint class (like addHint(new CacheUsageHint())).
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
Configure the cache usage of the query.protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
Configure the cache usage of the query.protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
Define a generic Hint.protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
INTERNAL: 325167: Make reserved # bind parameter char generic to enable native SQL pass throughprotected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
Define the query cache expiry hint.protected static class
Define the query cache expiry time of day hint.protected static class
Define the query cache hint.protected static class
Define the query cache ignore null hint.protected static class
Define the query cache ignore null hint.protected static class
Define the query cache randomized expiry hint.protected static class
Define the query cache size hint.protected static class
Define the query cache type hint.protected static class
protected static class
protected static class
protected static class
Configure the type of the query.protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
This hint can be used to indicate whether or not a ResultSetMapping query should return populated DatabaseRecords vs.protected static class
protected static class
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DatabaseQuery
apply
(String hintName, Object hintValue, DatabaseQuery query, ClassLoader loader, AbstractSession activeSession) Applies the hint to the query.static DatabaseQuery
apply
(Map<String, Object> hints, DatabaseQuery query, ClassLoader loader, AbstractSession activeSession) Applies the hints to the query.static boolean
parseBooleanHint
(Object hint) Common hint value processing into an boolean value.static int
parseIntegerHint
(Object hint, String hintName) Common hint value processing into an integer value.protected static boolean
shouldUseDefault
(Object hintValue) Empty String hintValue indicates that the default hint value should be used.static void
verify
(String hintName, Object hintValue, String queryName, AbstractSession session) Verifies the hint.static void
verify
(Map hints, String queryName, AbstractSession session) Verifies the hints.
-
Field Details
-
QUERY_HINT_PROPERTY
- See Also:
-
-
Method Details
-
verify
Verifies the hints. If session != null then logs a FINEST message for each hint. queryName parameter used only for identifying the query in messages, if it's null then "null" will be used. Throws IllegalArgumentException in case the hint value is illegal. -
verify
public static void verify(String hintName, Object hintValue, String queryName, AbstractSession session) Verifies the hint. If session != null then logs a FINEST message. queryName parameter used only for identifying the query in messages, if it's null then "null" will be used. Throws IllegalArgumentException in case the hint value is illegal. -
apply
public static DatabaseQuery apply(Map<String, Object> hints, DatabaseQuery query, ClassLoader loader, AbstractSession activeSession) Applies the hints to the query. Throws IllegalArgumentException in case the hint value is illegal. -
apply
public static DatabaseQuery apply(String hintName, Object hintValue, DatabaseQuery query, ClassLoader loader, AbstractSession activeSession) Applies the hint to the query. Throws IllegalArgumentException in case the hint value is illegal. -
parseBooleanHint
Common hint value processing into an boolean value. If the hint is null, false is returned. Those methods that need to handle a null hint to be something other than false should not call this method. -
parseIntegerHint
Common hint value processing into an integer value. If the hint is null, -1 is returned. -
shouldUseDefault
Empty String hintValue indicates that the default hint value should be used. -
getSupportedHints
-