|
Oracle Application Server TopLink API Reference 10g Release 2 (10.1.2) B15903-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.toplink.queryframework.DatabaseQuery
oracle.toplink.queryframework.ReadQuery
Purpose: Abstract class for all read queries.
Responsibilities:
Field Summary |
Fields inherited from class oracle.toplink.queryframework.DatabaseQuery |
CascadeAggregateDelete, CascadeAllParts, CascadeDependentParts, CascadePrivateParts, NoCascading, QUERY_PREPARE |
Constructor Summary | |
ReadQuery() PUBLIC: Initialize the state of the query |
Method Summary | |
void |
cacheQueryResults() ADVANCED: This method will instruct the query to cache the results returned by its next execution. |
void |
clearQueryResults() PUBLIC: Clears the current cached results, the next execution with read from the database. |
void |
doNotCacheQueryResults() ADVANCED: This method will instruct the query not to cache results. |
int |
getMaxRows() PUBLIC: Return the limit for the maximum number of rows that any ResultSet can contain to the given number. |
boolean |
isReadQuery() PUBLIC: Return if this is a read query. |
void |
setMaxRows(int maxRows) PUBLIC: Used to set the limit for the maximum number of rows that any ResultSet can contain to the given number. |
void |
setShouldCacheQueryResults(boolean shouldCacheQueryResults) ADVANCED: Use this method to configure whether or not the query should cache the results returned by its next execution. |
boolean |
shouldCacheQueryResults() PUBLIC: Return if the query should cache the results of the next execution or not. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ReadQuery()
Method Detail |
public void cacheQueryResults()
This method will instruct the query to cache the results returned by its next execution. All subsequent executions of this query will return this cached result set even if new query parameters are specified. This method provides a performance enhancement for queries known to always return the same result set. Oracle recommends that you use this method only for such queries.
To disable this behaviour, call doNotCacheQueryResults()
or setShouldCacheQueryResults(boolean)
passing in a boolean false.
public void clearQueryResults()
public void doNotCacheQueryResults()
This method will instruct the query not to cache results. All subsequent executions return result sets according to the current configuration of query parameters. After calling this method, any previously cached result set will be discarded the next time the query is executed.
This is equivalent to calling setShouldCacheQueryResults(boolean)
passing in a boolean false.
To enable this behaviour, call cacheQueryResults()
or setShouldCacheQueryResults(boolean)
passing in a boolean true.
public int getMaxRows()
public boolean isReadQuery()
isReadQuery
in class DatabaseQuery
public void setMaxRows(int maxRows)
public void setShouldCacheQueryResults(boolean shouldCacheQueryResults)
When shouldCacheQueryResults is true, this method instructs the query to cache the results returned by its next execution. All subsequent executions of this query will return this cached result set even if you specify new query parameters. This provides a performance enhancement for queries known to always return the same result set. Oracle recommends that you set this parameter to true only for such queries.
When shouldCacheQueryResults is false, this method instructs the query not to cache results. All subsequent executions of this query return result sets according to the current configuration of query parameters. After setting this parameter to false, any previously cached result set will be discarded the next time the query is executed.
shouldCacheQueryResults
- boolean true, the query caches results of its next execution; false, the query does not cache resultspublic boolean shouldCacheQueryResults()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |