public class LocalResultImpl extends java.lang.Object implements LocalResult
| Constructor and Description |
|---|
LocalResultImpl()
Construct a local result object.
|
LocalResultImpl(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.
|
boolean |
containsNull()
Check if this result set contains a NULL value.
|
LocalResultImpl |
createShallowCopy(SessionInterface 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.
|
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.
|
int |
getRowCount()
Get the number of rows in this object.
|
int |
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 |
isAutoIncrement(int i)
Check if this is an auto-increment column.
|
boolean |
isClosed()
Check if this result set is closed.
|
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 |
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 |
setDistinct(int[] distinctIndexes)
Remove rows with duplicates in columns with specified indexes.
|
void |
setFetchPercent(boolean fetchPercent) |
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 |
setMaxMemoryRows(int maxValue)
Redefine count of maximum rows holds in memory for the result.
|
void |
setOffset(int offset)
Set the offset of the first row to return.
|
void |
setSortOrder(SortOrder sort)
Sets sort order to be used by this result.
|
void |
setWithTies(SortOrder withTiesSortOrder)
Enables inclusion of tied rows to result and sets the sort order for tied
rows.
|
java.lang.String |
toString() |
public LocalResultImpl()
public LocalResultImpl(Session session, Expression[] expressions, int visibleColumnCount)
session - the sessionexpressions - the expression arrayvisibleColumnCount - the number of visible columnspublic boolean isLazy()
ResultInterfaceisLazy in interface ResultInterfacepublic void setMaxMemoryRows(int maxValue)
LocalResultsetMaxMemoryRows in interface LocalResultmaxValue - Maximum rows count in memory.SysProperties.MAX_MEMORY_ROWSpublic LocalResultImpl createShallowCopy(SessionInterface targetSession)
createShallowCopy in interface ResultInterfacetargetSession - the session of the copypublic void setSortOrder(SortOrder sort)
LocalResultsetSortOrder in interface LocalResultsort - the sort orderpublic void setDistinct()
setDistinct in interface LocalResultpublic void setDistinct(int[] distinctIndexes)
setDistinct in interface LocalResultdistinctIndexes - distinct indexespublic void removeDistinct(Value[] values)
removeDistinct in interface LocalResultvalues - the rowpublic boolean containsDistinct(Value[] values)
containsDistinct in interface LocalResultvalues - the rowpublic boolean containsNull()
LocalResultcontainsNull in interface LocalResultpublic void reset()
ResultInterfacereset in interface ResultInterfacepublic Value[] currentRow()
ResultInterfacecurrentRow in interface ResultInterfacepublic boolean next()
ResultInterfacenext in interface ResultInterfacepublic int getRowId()
ResultInterfacegetRowId in interface ResultInterfacepublic boolean isAfterLast()
ResultInterfaceisAfterLast in interface ResultInterfacepublic void addRow(Value[] values)
addRow in interface ResultTargetvalues - the row to addpublic int getVisibleColumnCount()
ResultInterfacegetVisibleColumnCount in interface ResultInterfacepublic void done()
done in interface LocalResultpublic int getRowCount()
ResultInterfacegetRowCount in interface ResultInterfacegetRowCount in interface ResultTargetpublic void limitsWereApplied()
ResultTargetlimitsWereApplied in interface ResultTargetpublic boolean hasNext()
ResultInterfacehasNext in interface ResultInterfacepublic void setLimit(int limit)
setLimit in interface LocalResultlimit - the limit (-1 means no limit, 0 means no rows)public void setFetchPercent(boolean fetchPercent)
setFetchPercent in interface LocalResultfetchPercent - whether limit expression specifies percentage of rowspublic void setWithTies(SortOrder withTiesSortOrder)
LocalResultsetWithTies in interface LocalResultwithTiesSortOrder - the sort order for tied rowspublic 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 getTableName(int i)
ResultInterfacegetTableName 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 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 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 void setOffset(int offset)
setOffset in interface LocalResultoffset - the offsetpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isClosed()
isClosed in interface ResultInterfacepublic int getFetchSize()
ResultInterfacegetFetchSize in interface ResultInterfacepublic void setFetchSize(int fetchSize)
ResultInterfacesetFetchSize in interface ResultInterfacefetchSize - the new fetch size