public class TempTableResultSet extends TableResultSet
temp-table DMO
. The data is read fully in memory and sent to the remote
side row by row; the DMO metadata is used to extract the properties and their settings (type
and extent). Note that each send row will have the values in the same order as the DMO's
properties.
The TempTableResultSet(Temporary, boolean, boolean, boolean)
must not be used outside
of the P2J runtime, as it is dependent on the P2J's persistence frame to read the DMO's data.
From Java code, use the TempTableResultSet()
to instantiate a new, empty, result set;
this will be used as a container to transport back the result and the metadat.
Type | Property and Description |
---|---|
PropertyDefinition |
next
Returns the next property of this DMO.
|
Modifier and Type | Field and Description |
---|---|
private Temporary |
dmo
The DMO associated with the temp table; this will be used to extract the DMO metadata and
the table data.
|
private java.util.Iterator<PropertyDefinition> |
propIter
Iterator over the DMO's properties.
|
private java.util.Iterator<java.lang.Object[]> |
rowIter
Iterator over the temp-table's data.
|
Constructor and Description |
---|
TempTableResultSet()
Default c'tor, explicitly added to allow instances of this class to be created on
deserialization.
|
TempTableResultSet(boolean output)
Create a new instance of this result set, when it acts as a container for an
OUTPUT parameter received from the remote side.
|
TempTableResultSet(Temporary dmo,
boolean input,
boolean output,
boolean append)
Create a new instance of this result set and associate it with the metadata and data for
the specified temp DMO.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasMoreProperties()
Check if there are more properties for this DMO.
|
boolean |
hasMoreRows()
Check if there are more rows for this table.
|
private void |
init()
Initialize this result set, by reading the entire temp-table in memory.
|
PropertyDefinition |
nextProperty()
Returns the next property of this DMO.
|
java.lang.Object[] |
nextRow()
Returns the data for the next row.
|
void |
setProperties(java.util.List<PropertyDefinition> properties)
Set the metadata sent by a remote side, after the remote appserver call.
|
void |
setRows(java.util.List<java.lang.Object[]> rows)
Set the data sent by a remote side, after the remote appserver call.
|
asResultSet, getProperties, getRows, isAppend, isInput, isOutput
public PropertyDefinition nextProperty
WARNING: this allows only one iteration over the properties and is for internal usage
only. Use TableResultSet.asResultSet()
and the associated ResultSetMetaData
instead.
nextProperty
in class TableResultSet
private Temporary dmo
private java.util.Iterator<PropertyDefinition> propIter
private java.util.Iterator<java.lang.Object[]> rowIter
public TempTableResultSet()
public TempTableResultSet(boolean output)
output
- Flag indicating this table is sent in OUTPUT mode. Must always be set to
true
.java.lang.IllegalStateException
- If the output
parameter is not set to true
.public TempTableResultSet(Temporary dmo, boolean input, boolean output, boolean append) throws java.lang.ClassNotFoundException
dmo
- DMO instance returned by a previous call to TemporaryBuffer.define(java.lang.Class<T>, java.lang.String, boolean)
on the
source temporary buffer.input
- Flag indicating this table is sent in INPUT or INPUT-OUTPUT mode.output
- Flag indicating this table is sent in OUTPUT or INPUT-OUTPUT mode.append
- Flag indicating this table is sent in APPEND mode.java.lang.ClassNotFoundException
- If the type of a property can not be resolved to a class.public void setRows(java.util.List<java.lang.Object[]> rows)
setRows
in class TableResultSet
rows
- The data sent by the remote side.public void setProperties(java.util.List<PropertyDefinition> properties)
setProperties
in class TableResultSet
properties
- The metadata sent by the remote side.public boolean hasMoreProperties()
WARNING: this allows only one iteration over the properties and is for internal usage
only. Use TableResultSet.asResultSet()
and the associated ResultSetMetaData
instead.
hasMoreProperties
in class TableResultSet
public PropertyDefinition nextProperty()
WARNING: this allows only one iteration over the properties and is for internal usage
only. Use TableResultSet.asResultSet()
and the associated ResultSetMetaData
instead.
nextProperty
in class TableResultSet
public boolean hasMoreRows()
WARNING: this allows only one iteration over the properties and is for internal usage
only. Use TableResultSet.asResultSet()
instead.
hasMoreRows
in class TableResultSet
public java.lang.Object[] nextRow()
WARNING: this allows only one iteration over the properties and is for internal usage
only. Use TableResultSet.asResultSet()
instead.
nextRow
in class TableResultSet
private void init() throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
- If the type of a property can not be resolved to a class.