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.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ARRAY
An Object[] of values is returned for each row. |
| public static final int | ATTRIBUTE
A single value is returned for each row. |
| public static final int | AUTO
Auto, a single value if a single field is selected, otherwise an Object[] (JPA default). |
| protected ContainerPolicy | |
| public static final 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. DatabaseRecord). |
| public static final int | VALUE
A single value is returned. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | buildObject(AbstractRecord row)
Overrides org. |
| public void | cacheResult(Object results)
Implements abstract org. This method is called by the object builder when building an original. |
| public Object | |
| public Object | Returns: An object or collection, the result of executing the query.- the session in which the receiver will be executed. session, AbstractRecord row)Overrides org. |
| public Object | Returns: a collection or cursor of Records representing the result setImplements abstract org. |
| protected Object | |
| public ContainerPolicy | |
| public int | getResultType()
Return the result type to be configured, MAP, ARRAY, VALUE, ATTRIBUTE (MAP is the default, DatabaseRecord). |
| public Converter | |
| public boolean | isDataReadQuery()
Overrides org. |
| protected void | prepare()
Overrides org. |
| public void | prepareForExecution()
Overrides org. |
| public Object | remoteExecute()
Overrides org. |
| public void | |
| public void | setResultType(int resultType)
Set the result type to be configured, MAP, ARRAY, VALUE, ATTRIBUTE (MAP is the default, DatabaseRecord). |
| public void | setResultType(String resultType)
Set the result type to be configured, Map, Array, Value, Attribute (Map is the default, DatabaseRecord). |
| public void | useCollectionClass(Class<?> concreteClass)
PUBLIC: Configure the query to use an instance of the specified container class to hold the target objects. |
| public void | |
| public void | useCursoredStream(int
the initial number of objects to read initialReadSize, int the number of objects to read when more objects
are needed from the database pageSize)PUBLIC: Use a CursoredStream as the result collection. |
| public void | useCursoredStream(int
the initial number of objects to read initialReadSize, int the number of objects to read when more objects
are needed from the database pageSize, ValueReadQuery 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) sizeQuery)PUBLIC: Use a CursoredStream as the result collection. |
| public void | |
| public void | useScrollableCursor(int
the number of elements to be read into a the cursor
when more elements are needed from the database. pageSize)PUBLIC: Use a ScrollableCursor as the result collection. |
| public void | useScrollableCursor(ScrollableCursorPolicy
the scrollable cursor policy allows for additional result set options.
Example: policy)ScrollableCursorPolicy policy = new ScrollableCursorPolicy() policy.setResultSetType(ScrollableCursorPolicy.TYPE_SCROLL_INSENSITIVE); query.useScrollableCursor(policy); PUBLIC: Use a ScrollableCursor as the result collection. |
| ARRAY | back to summary |
|---|---|
| public static final int ARRAY An Object[] of values is returned for each row. | |
| ATTRIBUTE | back to summary |
|---|---|
| public static final int ATTRIBUTE A single value is returned for each row. | |
| AUTO | back to summary |
|---|---|
| public static final int AUTO Auto, a single value if a single field is selected, otherwise an Object[] (JPA default). | |
| containerPolicy | back to summary |
|---|---|
| protected ContainerPolicy containerPolicy | |
| MAP | back to summary |
|---|---|
| public static final int MAP A Map (DatabaseRecord) is returned for each row. | |
| resultType | back to summary |
|---|---|
| protected int resultType Allow return type to be configured, MAP, ARRAY, VALUE, ATTRIBUTE (MAP is the default, i.e. DatabaseRecord). | |
| VALUE | back to summary |
|---|---|
| public static final int VALUE A single value is returned. | |
| DataReadQuery | back to summary |
|---|---|
| public DataReadQuery() PUBLIC: Initialize the state of the query. | |
| DataReadQuery | back to summary |
|---|---|
| public DataReadQuery(String sqlString) PUBLIC: Initialize the query to use the specified SQL string. Warning Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks. | |
| DataReadQuery | back to summary |
|---|---|
| public DataReadQuery(Call call) PUBLIC: Initialize the query to use the specified call. | |
| buildObject | back to summary |
|---|---|
| public Object buildObject(AbstractRecord row) Overrides org. INTERNAL: Build the result value for the row.
| |
| cacheResult | back to summary |
|---|---|
| public void cacheResult(Object results) Implements abstract org. INTERNAL: 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.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides org. INTERNAL: Clone the query.
| |
| execute | back to summary |
|---|---|
| public Object execute(AbstractSession session, AbstractRecord row) throws DatabaseException Overrides org. INTERNAL: Execute the query. If there are cached results return those. This must override the super to support result caching.
| |
| executeDatabaseQuery | back to summary |
|---|---|
| public Object executeDatabaseQuery() throws DatabaseException Implements abstract org. INTERNAL: Execute the query. Perform the work to execute the SQL string.
| |
| executeNonCursor | back to summary |
|---|---|
| protected Object executeNonCursor() throws DatabaseException INTERNAL: The results are *not* in a cursor, build the collection. Cache the results in temporaryCachedQueryResults. | |
| getContainerPolicy | back to summary |
|---|---|
| public ContainerPolicy getContainerPolicy() PUBLIC: Return the query's ContainerPolicy. | |
| getResultType | back to summary |
|---|---|
| public int getResultType() Return the result type to be configured, MAP, ARRAY, VALUE, ATTRIBUTE (MAP is the default, DatabaseRecord).
| |
| getValueConverter | back to summary |
|---|---|
| public Converter getValueConverter() INTERNAL: Conversion not supported. | |
| isDataReadQuery | back to summary |
|---|---|
| public boolean isDataReadQuery() Overrides org. PUBLIC: Return if this is a data read query.
| |
| prepare | back to summary |
|---|---|
| protected void prepare() Overrides org. INTERNAL: Prepare the receiver for execution in a session.
| |
| prepareForExecution | back to summary |
|---|---|
| public void prepareForExecution() throws QueryException Overrides org. INTERNAL: Prepare the receiver for execution in a session.
| |
| remoteExecute | back to summary |
|---|---|
| public Object remoteExecute() Overrides org. INTERNAL: Used by RemoteSession.
| |
| setContainerPolicy | back to summary |
|---|---|
| public void setContainerPolicy(ContainerPolicy containerPolicy) PUBLIC: Set the container policy. | |
| setResultType | back to summary |
|---|---|
| public void setResultType(int resultType) Set the result type to be configured, MAP, ARRAY, VALUE, ATTRIBUTE (MAP is the default, DatabaseRecord). | |
| setResultType | back to summary |
|---|---|
| public void setResultType(String resultType) Set the result type to be configured, Map, Array, Value, Attribute (Map is the default, DatabaseRecord).
| |
| useCollectionClass | back to summary |
|---|---|
| public void useCollectionClass(Class<?> concreteClass) PUBLIC: Configure the query to use an instance of the specified container class to hold the target objects. The container class must implement (directly or indirectly) the Collection interface. | |
| useCursoredStream | back to summary |
|---|---|
| public void useCursoredStream() PUBLIC: Use a CursoredStream as the result collection. The initial read size is 10 and page size is 5. | |
| useCursoredStream | back to summary |
|---|---|
| public void useCursoredStream(int initialReadSize, int pageSize) PUBLIC: Use a CursoredStream as the result collection.
| |
| useCursoredStream | back to summary |
|---|---|
| public void useCursoredStream(int initialReadSize, int pageSize, ValueReadQuery sizeQuery) PUBLIC: Use a CursoredStream as the result collection.
| |
| useScrollableCursor | back to summary |
|---|---|
| public void useScrollableCursor() PUBLIC: Use a ScrollableCursor as the result collection. | |
| useScrollableCursor | back to summary |
|---|---|
| public void useScrollableCursor(int pageSize) PUBLIC: Use a ScrollableCursor as the result collection.
| |
| useScrollableCursor | back to summary |
|---|---|
| public void useScrollableCursor(ScrollableCursorPolicy policy) PUBLIC: Use a ScrollableCursor as the result collection.
| |