You can specify EclipseLink query hints (JPA query extensions) by:
Using the @QueryHint
annotation
Including the hints in the orm.xml
or eclipselink-orm.xml
file
Using the setHint()
method when executing a named or dynamic query (JPQL or Criteria)
Oracle TopLink supports the following EclipseLink query hints:
All EclipseLink query hints are defined in the QueryHints
class in the org.eclipse.persistence.config package
. When you set a hint, you can set the value using the public static final field in the appropriate configuration class in org.eclipse.persistence.config
package, including the following:
HintValues
CacheUsage
PessimisticLock
QueryType
For more information, see:
"Query Hints" in Understanding Oracle TopLink
"Query" in Solutions Guide for Oracle TopLink
Section 10.3.1 "NamedQuery Annotation" in the JPA Specification (http://jcp.org/en/jsr/detail?id=317
)