Advanced Query Options
Use to specify additional query options.
- Maintain Cache
- Specify
maintainCache()
for the named query.
- Use Wrapper Policy
- Specify the
setWrapperPolicy()
for the named query.
- Prepare SQL Once
- Specify the
setShouldPrepare()
for the named query. By default, TopLink optimizes queries to generate their SQL only once. You may need to disable this option for certain types of queries that require dynamic SQL based on their arguments, such as:
-
- Expressions that use equal where the argument value could be null. This may cause problems on databases that require IS NULL, instead of = NULL.
- Expressions that use in and use parameter binding. This will cause problems as the in values must be bound individually.
- Cache Query Results
- Specify the
cacheQueryResults()
for the query. TopLink can maintains an internal cache of the objects previously returned by a read query.
- Refresh Remote Identity Map Results
- Specify the
refreshRemoteIdentityMapResult()
method for the query. TopLink can refresh the attributes of the object(s) resulting from the query. With cascading, TopLink will also refresh the private parts of the object(s).
- Pessimistic Locking
- Specify the pessimistic locking policy for the query.
- Distinct State
- Specify if TopLink prints the DISTINCT clause, if a distinct has been set.
- Query Timeout
- Specify if there is No Timeout, or if the query will time out (or abort) after a specified number of seconds.
- Maximum Rows
- Specify if there is No Maximum, or if the query will limit the results to a specified number of rows. Use this to option for queries that could return an excessive number of objects.
Related Topics
Named Queries
Specifying Queries
Working with Descriptor Properties
Copyright © 1997, 2004, Oracle.
All rights reserved.