public class SimpleResult extends java.lang.Object implements ResultInterface, ResultTarget
| Constructor and Description |
|---|
SimpleResult()
Creates new instance of simple result.
|
SimpleResult(java.lang.String schemaName,
java.lang.String tableName)
Creates new instance of simple result.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(java.lang.String alias,
java.lang.String columnName,
int columnType,
long columnPrecision,
int columnScale)
Add column to the result.
|
void |
addColumn(java.lang.String alias,
java.lang.String columnName,
TypeInfo columnType)
Add column to the result.
|
void |
addColumn(java.lang.String columnName,
TypeInfo columnType)
Add column to the result.
|
void |
addRow(Value... values)
Add the row to the result set.
|
void |
close()
Close the result and delete any temporary files
|
SimpleResult |
createShallowCopy(Session targetSession)
Create a shallow copy of the result set.
|
Value[] |
currentRow()
Get the current row.
|
java.lang.String |
getAlias(int i)
Get the column alias name for the column.
|
java.lang.String |
getColumnName(int i)
Get the column name.
|
TypeInfo |
getColumnType(int i)
Get the column data type.
|
int |
getFetchSize()
Get the current fetch size for this result set.
|
int |
getNullable(int i)
Check if this column is nullable.
|
long |
getRowCount()
Get the number of rows in this object.
|
long |
getRowId()
Get the current row id, starting with 0.
|
java.lang.String |
getSchemaName(int i)
Get the schema name for the column, if one exists.
|
java.lang.String |
getTableName(int i)
Get the table name for the column, if one exists.
|
int |
getVisibleColumnCount()
Get the number of visible columns.
|
boolean |
hasNext()
Check if this result has more rows to fetch.
|
boolean |
isAfterLast()
Check if the current position is after last row.
|
boolean |
isClosed()
Check if this result set is closed.
|
boolean |
isIdentity(int i)
Check if this is an identity column.
|
boolean |
isLazy()
Check if this a lazy execution result.
|
void |
limitsWereApplied()
A hint that sorting, offset and limit may be ignored by this result
because they were applied during the query.
|
boolean |
needToClose()
Check if this result set should be closed, for example because it is
buffered using a temporary file.
|
boolean |
next()
Go to the next row.
|
void |
reset()
Go to the beginning of the result, that means
before the first row.
|
void |
setFetchSize(int fetchSize)
Set the fetch size for this result set.
|
void |
sortRows(java.util.Comparator<? super Value[]> comparator)
Sort rows in the list.
|
public SimpleResult()
public SimpleResult(java.lang.String schemaName,
java.lang.String tableName)
schemaName - the name of the schematableName - the name of the tablepublic void addColumn(java.lang.String alias,
java.lang.String columnName,
int columnType,
long columnPrecision,
int columnScale)
alias - Column's alias.columnName - Column's name.columnType - Column's value type.columnPrecision - Column's precision.columnScale - Column's scale.public void addColumn(java.lang.String columnName,
TypeInfo columnType)
columnName - Column's name.columnType - Column's type.public void addColumn(java.lang.String alias,
java.lang.String columnName,
TypeInfo columnType)
alias - Column's alias.columnName - Column's name.columnType - Column's type.public void addRow(Value... values)
ResultTargetaddRow in interface ResultTargetvalues - the valuespublic void reset()
ResultInterfacereset in interface ResultInterfacepublic Value[] currentRow()
ResultInterfacecurrentRow in interface ResultInterfacepublic boolean next()
ResultInterfacenext in interface ResultInterfacepublic long getRowId()
ResultInterfacegetRowId in interface ResultInterfacepublic boolean isAfterLast()
ResultInterfaceisAfterLast in interface ResultInterfacepublic int getVisibleColumnCount()
ResultInterfacegetVisibleColumnCount in interface ResultInterfacepublic long getRowCount()
ResultInterfacegetRowCount in interface ResultInterfacegetRowCount in interface ResultTargetpublic boolean hasNext()
ResultInterfacehasNext in interface ResultInterfacepublic boolean needToClose()
ResultInterfaceneedToClose in interface ResultInterfacepublic void close()
ResultInterfaceclose in interface java.lang.AutoCloseableclose in interface ResultInterfacepublic java.lang.String getAlias(int i)
ResultInterfacegetAlias in interface ResultInterfacei - the column number (starting with 0)public java.lang.String getSchemaName(int i)
ResultInterfacegetSchemaName in interface ResultInterfacei - the column number (starting with 0)public java.lang.String getTableName(int i)
ResultInterfacegetTableName in interface ResultInterfacei - the column number (starting with 0)public java.lang.String getColumnName(int i)
ResultInterfacegetColumnName in interface ResultInterfacei - the column number (starting with 0)public TypeInfo getColumnType(int i)
ResultInterfacegetColumnType in interface ResultInterfacei - the column number (starting with 0)public boolean isIdentity(int i)
ResultInterfaceisIdentity in interface ResultInterfacei - the column number (starting with 0)public int getNullable(int i)
ResultInterfacegetNullable in interface ResultInterfacei - the column number (starting with 0)public void setFetchSize(int fetchSize)
ResultInterfacesetFetchSize in interface ResultInterfacefetchSize - the new fetch sizepublic int getFetchSize()
ResultInterfacegetFetchSize in interface ResultInterfacepublic boolean isLazy()
ResultInterfaceisLazy in interface ResultInterfacepublic boolean isClosed()
ResultInterfaceisClosed in interface ResultInterfacepublic SimpleResult createShallowCopy(Session targetSession)
ResultInterfacecreateShallowCopy in interface ResultInterfacetargetSession - the session of the copypublic void limitsWereApplied()
ResultTargetlimitsWereApplied in interface ResultTargetpublic void sortRows(java.util.Comparator<? super Value[]> comparator)
comparator - the comparator