Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.queryframework
Class DataReadQuery

java.lang.Object
  extended byoracle.toplink.queryframework.DatabaseQuery
      extended byoracle.toplink.queryframework.ReadQuery
          extended byoracle.toplink.queryframework.DataReadQuery

All Implemented Interfaces:
java.lang.Cloneable, oracle.toplink.internal.helper.FalseUndefinedTrue, java.io.Serializable
Direct Known Subclasses:
DirectReadQuery

public class DataReadQuery
extends ReadQuery

Purpose: Concrete class to perform read using raw SQL.

Responsibilities: Execute a selecting raw SQL string. This returns a Collection of the DatabaseRows representing the result set.

Since:
TOPLink/Java 1.0
See Also:
Serialized Form

Field Summary

Fields inherited from class oracle.toplink.queryframework.DatabaseQuery
CascadeAggregateDelete, CascadeAllParts, CascadeDependentParts, CascadePrivateParts, NoCascading, QUERY_PREPARE

Constructor Summary
DataReadQuery()
PUBLIC: Initialize the state of the query.
DataReadQuery(Call call)
PUBLIC: Initialize the query to use the specified call.
DataReadQuery(java.lang.String sqlString)
PUBLIC: Initialize the query to use the specified SQL string.

Method Summary
oracle.toplink.internal.queryframework.ContainerPolicy getContainerPolicy()
PUBLIC: Return the query's ContainerPolicy.
boolean isDataReadQuery()
PUBLIC: Return if this is a data read query.
void setContainerPolicy(oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
PUBLIC: Set the container policy.
void useCollectionClass(java.lang.Class concreteClass)
PUBLIC: Configure the query to use an instance of the specified container class to hold the target objects.
void useCursoredStream()
PUBLIC: Use a CursoredStream as the result collection.
void useCursoredStream(int initialReadSize, int pageSize)
PUBLIC: Use a CursoredStream as the result collection.
void useCursoredStream(int initialReadSize, int pageSize, ValueReadQuery sizeQuery)
PUBLIC: Use a CursoredStream as the result collection.
void useScrollableCursor()
PUBLIC: Use a ScrollableCursor as the result collection.
void useScrollableCursor(int pageSize)
PUBLIC: Use a ScrollableCursor as the result collection.
void useScrollableCursor(ScrollableCursorPolicy policy)
PUBLIC: Use a ScrollableCursor as the result collection.

Methods inherited from class oracle.toplink.queryframework.ReadQuery
cacheQueryResults, clearQueryResults, doNotCacheQueryResults, getMaxRows, isReadQuery, setMaxRows, setShouldCacheQueryResults, shouldCacheQueryResults

Methods inherited from class oracle.toplink.queryframework.DatabaseQuery
addArgument, addArgument, addArgument, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, cacheStatement, cascadeAllParts, cascadePrivateParts, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, getCall, getEJBQLString, getHintString, getName, getQueryTimeout, getRedirector, getReferenceClass, getSelectionCriteria, getSessionName, getSQLStatement, getSQLString, getTranslatedSQLString, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isDataModifyQuery, isDeleteObjectQuery, isExpressionQuery, isModifyQuery, isObjectLevelModifyQuery, isObjectLevelReadQuery, isReadAllQuery, isReadObjectQuery, isReportQuery, isSQLCallQuery, isWriteObjectQuery, maintainCache, prepareCall, setCall, setEJBQLString, setHintString, setName, setQueryTimeout, setRedirector, setSelectionCriteria, setSessionName, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldUseWrapperPolicy, setSQLStatement, setSQLString, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeParts, shouldCascadePrivateParts, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldUseWrapperPolicy, toString

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DataReadQuery

public DataReadQuery()
PUBLIC: Initialize the state of the query.

DataReadQuery

public DataReadQuery(java.lang.String sqlString)
PUBLIC: Initialize the query to use the specified SQL string.

DataReadQuery

public DataReadQuery(Call call)
PUBLIC: Initialize the query to use the specified call.

Method Detail

getContainerPolicy

public oracle.toplink.internal.queryframework.ContainerPolicy getContainerPolicy()
PUBLIC: Return the query's ContainerPolicy.
Returns:
oracle.toplink.internal.queryframework.ContainerPolicy

isDataReadQuery

public boolean isDataReadQuery()
PUBLIC: Return if this is a data read query.
Overrides:
isDataReadQuery in class DatabaseQuery

setContainerPolicy

public void setContainerPolicy(oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
PUBLIC: Set the container policy.

useCollectionClass

public void useCollectionClass(java.lang.Class concreteClass)
PUBLIC: Configure the query to use an instance of the specified container class to hold the target objects.

jdk1.2.x: The container class must implement (directly or indirectly) the Collection interface.

jdk1.1.x: The container class must be a subclass of Vector.


useCursoredStream

public void useCursoredStream()
PUBLIC: Use a CursoredStream as the result collection. The initial read size is 10 and page size is 5.

useCursoredStream

public void useCursoredStream(int initialReadSize,
                              int pageSize)
PUBLIC: Use a CursoredStream as the result collection.
Parameters:
initialReadSize - the initial number of objects to read
pageSize - the number of objects to read when more objects are needed from the database

useCursoredStream

public void useCursoredStream(int initialReadSize,
                              int pageSize,
                              ValueReadQuery sizeQuery)
PUBLIC: Use a CursoredStream as the result collection.
Parameters:
initialReadSize - the initial number of objects to read
pageSize - the number of objects to read when more objects are needed from the database
sizeQuery - a query that will return the size of the result set; this must be set if an expression is not used (i.e. custom SQL)

useScrollableCursor

public void useScrollableCursor()
PUBLIC: Use a ScrollableCursor as the result collection.

useScrollableCursor

public void useScrollableCursor(int pageSize)
PUBLIC: Use a ScrollableCursor as the result collection.
Parameters:
pageSize - the number of elements to be read into a the cursor when more elements are needed from the database.

useScrollableCursor

public void useScrollableCursor(ScrollableCursorPolicy policy)
PUBLIC: Use a ScrollableCursor as the result collection.
Parameters:
policy - the scrollable cursor policy allows for additional result set options. Example:

ScrollableCursorPolicy policy = new ScrollableCursorPolicy()

policy.setResultSetType(ScrollableCursorPolicy.TYPE_SCROLL_INSENSITIVE);

query.useScrollableCursor(policy);


Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.