Package org.apache.cayenne.query
Class RefreshQuery
java.lang.Object
org.apache.cayenne.query.RefreshQuery
- All Implemented Interfaces:
Serializable
,Query
A query that allows to explicitly clear both object and list caches either via refetch
(eager refresh) or invalidate (lazy refresh).
- Since:
- 3.0
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDeprecated.since 4.0, "refresh all" query will drop all cache contentsRefreshQuery
(String... groupKeys) Creates a RefreshQuery that refreshes query results identified by group keys.RefreshQuery
(Collection<?> objects) Creates a RefreshQuery that refreshes a collection of objects, including invalidation of their relationships.RefreshQuery
(Persistent object) Creates a RefreshQuery that refreshes a single object, including invalidation of its relationships.RefreshQuery
(Query query) Creates a RefreshQuery that refreshes results of a query and individual objects in the result. -
Method Summary
Modifier and TypeMethodDescriptioncreateSQLAction
(SQLActionVisitor visitor) A callback method invoked by Cayenne during the final execution phase of the query run.String[]
getMetaData
(EntityResolver resolver) Returns query runtime parameters.Collection
<?> getQuery()
Returns an internal query, overriding cache policy to force a refresh.boolean
void
route
(QueryRouter router, EntityResolver resolver, Query substitutedQuery) A callback method invoked by Cayenne during the routing phase of the query execution.
-
Field Details
-
objects
-
query
-
groupKeys
-
-
Constructor Details
-
RefreshQuery
Deprecated.since 4.0, "refresh all" query will drop all cache contentsCreates a RefreshQuery that does full refresh of all registered objects, cascading refresh all the way to the shared cache.- See Also:
-
RefreshQuery
Creates a RefreshQuery that refreshes a collection of objects, including invalidation of their relationships. -
RefreshQuery
Creates a RefreshQuery that refreshes a single object, including invalidation of its relationships. -
RefreshQuery
Creates a RefreshQuery that refreshes results of a query and individual objects in the result. -
RefreshQuery
Creates a RefreshQuery that refreshes query results identified by group keys.
-
-
Method Details
-
getMetaData
Description copied from interface:Query
Returns query runtime parameters. The method is called at various stages of the execution by Cayenne access stack to retrieve query parameters. EntityResolver instance is passed to this method, meaning that the query doesn't need to store direct references to Cayenne mapping objects and can resolve them at runtime.- Specified by:
getMetaData
in interfaceQuery
-
route
Description copied from interface:Query
A callback method invoked by Cayenne during the routing phase of the query execution. Mapping of DataNodes is provided by QueryRouter. Query should use aQueryRouter.route(QueryEngine, Query, Query)
callback method to route itself. Query can create one or more substitute queries or even provide its own QueryEngine to execute itself. -
createSQLAction
Description copied from interface:Query
A callback method invoked by Cayenne during the final execution phase of the query run. A concrete query implementation is given a chance to decide how it should be handled. Implementors can pick an appropriate method of the SQLActionVisitor to handle itself, create a custom SQLAction of its own, or substitute itself with another query that should be used for SQLAction construction.- Specified by:
createSQLAction
in interfaceQuery
-
isRefreshAll
public boolean isRefreshAll() -
getGroupKeys
-
getObjects
-
getQuery
Returns an internal query, overriding cache policy to force a refresh. Returns null if no query was set.
-