public class LocalResult extends Object implements ResultInterface, ResultTarget
| Constructor and Description |
|---|
LocalResult()
Construct a local result object.
|
LocalResult(Session session,
Expression[] expressions,
int visibleColumnCount)
Construct a local result object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(Value[] values)
Add a row to this object.
|
void |
close()
Close the result and delete any temporary files
|
boolean |
containsDistinct(Value[] values)
Check if this result set contains the given row.
|
LocalResult |
createShallowCopy(Session targetSession)
Create a shallow copy of the result set.
|
Value[] |
currentRow()
Get the current row.
|
void |
done()
This method is called after all rows have been added.
|
String |
getAlias(int i)
Get the column alias name for the column.
|
String |
getColumnName(int i)
Get the column name.
|
long |
getColumnPrecision(int i)
Get the precision for this column.
|
int |
getColumnScale(int i)
Get the scale for this column.
|
int |
getColumnType(int i)
Get the column data type.
|
int |
getDisplaySize(int i)
Get the display size for this column.
|
int |
getFetchSize()
Get the current fetch size for this result set.
|
int |
getNullable(int i)
Check if this column is nullable.
|
int |
getRowCount()
Get the number of rows in this object.
|
int |
getRowId()
Get the current row id, starting with 0.
|
String |
getSchemaName(int i)
Get the schema name for the column, if one exists.
|
String |
getTableName(int i)
Get the table name for the column, if one exists.
|
int |
getVisibleColumnCount()
Get the number of visible columns.
|
boolean |
isAutoIncrement(int i)
Check if this is an auto-increment column.
|
boolean |
isClosed()
Check if this result set is closed.
|
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.
|
static LocalResult |
read(Session session,
ResultSet rs,
int maxrows)
Construct a local result set by reading all data from a regular result set.
|
void |
removeDistinct(Value[] values)
Remove the row from the result set if it exists.
|
void |
reset()
Go to the beginning of the result, that means
before the first row.
|
void |
setDistinct()
Remove duplicate rows.
|
void |
setFetchSize(int fetchSize)
Set the fetch size for this result set.
|
void |
setLimit(int limit)
Set the number of rows that this result will return at the maximum.
|
void |
setOffset(int offset)
Set the offset of the first row to return.
|
void |
setRandomAccess()
Random access is required (containsDistinct).
|
void |
setSortOrder(SortOrder sort)
Set the sort order.
|
String |
toString() |
public LocalResult()
public LocalResult(Session session, Expression[] expressions, int visibleColumnCount)
session - the sessionexpressions - the expression arrayvisibleColumnCount - the number of visible columnspublic static LocalResult read(Session session, ResultSet rs, int maxrows)
session - the sessionrs - the result setmaxrows - the maximum number of rows to read (0 for no limit)public LocalResult createShallowCopy(Session targetSession)
targetSession - the session of the copypublic void setSortOrder(SortOrder sort)
sort - the sort orderpublic void setDistinct()
public void setRandomAccess()
public void removeDistinct(Value[] values)
values - the rowpublic boolean containsDistinct(Value[] values)
values - the rowpublic void reset()
ResultInterfacereset in interface ResultInterfacepublic Value[] currentRow()
ResultInterfacecurrentRow in interface ResultInterfacepublic boolean next()
ResultInterfacenext in interface ResultInterfacepublic int getRowId()
ResultInterfacegetRowId in interface ResultInterfacepublic void addRow(Value[] values)
addRow in interface ResultTargetvalues - the row to addpublic int getVisibleColumnCount()
ResultInterfacegetVisibleColumnCount in interface ResultInterfacepublic void done()
public int getRowCount()
ResultInterfacegetRowCount in interface ResultInterfacegetRowCount in interface ResultTargetpublic void setLimit(int limit)
limit - the limit (-1 means no limit, 0 means no rows)public boolean needToClose()
ResultInterfaceneedToClose in interface ResultInterfacepublic void close()
ResultInterfaceclose in interface ResultInterfacepublic String getAlias(int i)
ResultInterfacegetAlias in interface ResultInterfacei - the column number (starting with 0)public String getTableName(int i)
ResultInterfacegetTableName in interface ResultInterfacei - the column number (starting with 0)public String getSchemaName(int i)
ResultInterfacegetSchemaName in interface ResultInterfacei - the column number (starting with 0)public int getDisplaySize(int i)
ResultInterfacegetDisplaySize in interface ResultInterfacei - the column number (starting with 0)public String getColumnName(int i)
ResultInterfacegetColumnName in interface ResultInterfacei - the column number (starting with 0)public int getColumnType(int i)
ResultInterfacegetColumnType in interface ResultInterfacei - the column number (starting with 0)public long getColumnPrecision(int i)
ResultInterfacegetColumnPrecision 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 boolean isAutoIncrement(int i)
ResultInterfaceisAutoIncrement in interface ResultInterfacei - the column number (starting with 0)public int getColumnScale(int i)
ResultInterfacegetColumnScale in interface ResultInterfacei - the column number (starting with 0)public void setOffset(int offset)
offset - the offsetpublic boolean isClosed()
public int getFetchSize()
ResultInterfacegetFetchSize in interface ResultInterfacepublic void setFetchSize(int fetchSize)
ResultInterfacesetFetchSize in interface ResultInterfacefetchSize - the new fetch sizeCopyright © 2012 JBoss by Red Hat. All Rights Reserved.