Use @QueryRedirectors to intercept TopLink queries for pre- and post-processing, redirection, or performing some side effect such as auditing.
Table 2-56 describes this annotation's elements.
Table 2-56 @QueryRedirectors Annotation Elements
| Annotation Element | Description | Default |
|---|---|---|
|
|
This |
|
|
|
A Default |
|
|
insert |
A Default |
|
|
readAll |
A Default For users executing a JPA Query through the |
|
|
|
A Default For users executing a JPA Query through the |
|
|
|
A Default For users executing a JPA Query that contains aggregate functions or selects multiple entities this is the redirector that will be invoked |
|
|
|
A Default |
|
Use @QueryRedirectors to extend the standard TopLink query functionality.
You can set a QueryRedirector through the Query Hint eclipselink.query.redirector or set as a default Redirector on an Entity.
QueryRedirectors are used when integrating TopLink Grid to redirect queries to the Coherence grid.
Example 2-94 shows how to use this annotation.
Example 2-94 Using @QueryRedirectors Annotation
@QueryRedirectors(
allQueries=org.queryredirectors.AllQueriesForEntity.class)
@Entity
public class
...
For more information, see:
"Database Queries" in the Understanding Oracle TopLink