|
EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.queries.DatabaseQuery
org.eclipse.persistence.queries.ReadQuery
org.eclipse.persistence.queries.DataReadQuery
public class DataReadQuery
Purpose: Concrete class to perform read using raw SQL.
Responsibilities: Execute a selecting raw SQL string. This returns a Collection of the Records representing the result set.
Field Summary | |
---|---|
static int |
ARRAY
An Object[] of values is returned for each row. |
static int |
ATTRIBUTE
A single value is returned for each row. |
static int |
AUTO
Auto, a single value if a single field is selected, otherwise an Object[] (JPA default). |
protected org.eclipse.persistence.internal.queries.ContainerPolicy |
containerPolicy
|
static int |
MAP
A Map (DatabaseRecord) is returned for each row. |
protected int |
resultType
Allow return type to be configured, MAP, ARRAY, VALUE, ATTRIBUTE (MAP is the default, i.e. |
static int |
VALUE
A single value is returned. |
Fields inherited from class org.eclipse.persistence.queries.ReadQuery |
---|
fetchSize, firstResult, maxRows, queryId, queryResultCachingPolicy, temporaryCachedQueryResults |
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 | |
---|---|
java.lang.Object |
buildObject(org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: Build the result value for the row. |
void |
cacheResult(java.lang.Object results)
INTERNAL: This method is called by the object builder when building an original. |
java.lang.Object |
clone()
INTERNAL: Clone the query. |
java.lang.Object |
execute(org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: Execute the query. |
java.lang.Object |
executeDatabaseQuery()
INTERNAL: Execute the query. |
protected java.lang.Object |
executeNonCursor()
INTERNAL: The results are *not* in a cursor, build the collection. |
org.eclipse.persistence.internal.queries.ContainerPolicy |
getContainerPolicy()
PUBLIC: Return the query's ContainerPolicy. |
int |
getResultType()
Return the result type to be configured, MAP, ARRAY, VALUE, ATTRIBUTE (MAP is the default, DatabaseRecord). |
Converter |
getValueConverter()
INTERNAL: Conversion not supported. |
boolean |
isDataReadQuery()
PUBLIC: Return if this is a data read query. |
protected void |
prepare()
INTERNAL: Prepare the receiver for execution in a session. |
void |
prepareForExecution()
INTERNAL: Prepare the receiver for execution in a session. |
java.lang.Object |
remoteExecute()
INTERNAL: |
void |
setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
PUBLIC: Set the container policy. |
void |
setResultType(int resultType)
Set the result type to be configured, MAP, ARRAY, VALUE, ATTRIBUTE (MAP is the default, DatabaseRecord). |
void |
setResultType(java.lang.String resultType)
Set the result type to be configured, Map, Array, Value, Attribute (Map is the default, DatabaseRecord). |
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 java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy
protected int resultType
public static final int MAP
public static final int ARRAY
public static final int VALUE
public static final int ATTRIBUTE
public static final int AUTO
Constructor Detail |
---|
public DataReadQuery()
public DataReadQuery(java.lang.String sqlString)
public DataReadQuery(Call call)
Method Detail |
---|
public void cacheResult(java.lang.Object results)
This method is called by the object builder when building an original. It will cause the original to be cached in the query results if the query is set to do so.
cacheResult
in class ReadQuery
public java.lang.Object clone()
clone
in class DatabaseQuery
public java.lang.Object execute(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord row) throws DatabaseException
execute
in class DatabaseQuery
aSession
- - the session in which the receiver will be executed.
DatabaseException
- - an error has occurred on the databasepublic java.lang.Object executeDatabaseQuery() throws DatabaseException
executeDatabaseQuery
in class DatabaseQuery
DatabaseException
- an error has occurred on the databasepublic Converter getValueConverter()
public java.lang.Object buildObject(org.eclipse.persistence.internal.sessions.AbstractRecord row)
buildObject
in class ReadQuery
protected java.lang.Object executeNonCursor() throws DatabaseException
DatabaseException
public org.eclipse.persistence.internal.queries.ContainerPolicy getContainerPolicy()
public boolean isDataReadQuery()
isDataReadQuery
in class DatabaseQuery
protected void prepare()
prepare
in class ReadQuery
public void prepareForExecution() throws QueryException
prepareForExecution
in class ReadQuery
QueryException
public java.lang.Object remoteExecute()
remoteExecute
in class DatabaseQuery
public void setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
public void useCollectionClass(java.lang.Class concreteClass)
public void useCursoredStream()
public int getResultType()
ResultType
public void setResultType(int resultType)
public void setResultType(java.lang.String resultType)
ResultType
public void useCursoredStream(int initialReadSize, int pageSize)
initialReadSize
- the initial number of objects to readpageSize
- the number of objects to read when more objects
are needed from the databasepublic void useCursoredStream(int initialReadSize, int pageSize, ValueReadQuery sizeQuery)
initialReadSize
- the initial number of objects to readpageSize
- the number of objects to read when more objects
are needed from the databasesizeQuery
- 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)public void useScrollableCursor()
public void useScrollableCursor(int pageSize)
pageSize
- the number of elements to be read into a the cursor
when more elements are needed from the database.public void useScrollableCursor(ScrollableCursorPolicy policy)
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);
|
EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |