Package org.h2.result
Class LazyResult
java.lang.Object
org.h2.result.FetchedResult
org.h2.result.LazyResult
- All Implemented Interfaces:
AutoCloseable,ResultInterface
Lazy execution support for queries.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the result and delete any temporary filesprotected abstract Value[]Fetch next row or null if none available.getAlias(int i) Get the column alias name for the column.getColumnName(int i) Get the column name.getColumnType(int i) Get the column data type.intGet the current fetch size for this result set.intgetNullable(int i) Check if this column is nullable.longGet the number of rows in this object.getSchemaName(int i) Get the schema name for the column, if one exists.getTableName(int i) Get the table name for the column, if one exists.booleanhasNext()Check if this result has more rows to fetch.booleanisClosed()Check if this result set is closed.booleanisIdentity(int i) Check if this is an identity column.booleanisLazy()Check if this a lazy execution result.voidreset()Go to the beginning of the result, that means before the first row.voidsetFetchSize(int fetchSize) Set the fetch size for this result set.voidsetLimit(long limit) booleanskip()Go to the next row and skip it.protected booleanSkip next row.Methods inherited from class org.h2.result.FetchedResult
createShallowCopy, currentRow, getRowId, isAfterLast, needToClose, nextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.h2.result.ResultInterface
getVisibleColumnCount
-
Constructor Details
-
LazyResult
-
-
Method Details
-
setLimit
public void setLimit(long limit) -
isLazy
public boolean isLazy()Description copied from interface:ResultInterfaceCheck if this a lazy execution result.- Returns:
- true if it is a lazy result
-
reset
public void reset()Description copied from interface:ResultInterfaceGo to the beginning of the result, that means before the first row. -
skip
public boolean skip()Go to the next row and skip it.- Returns:
- true if a row exists
-
hasNext
public boolean hasNext()Description copied from interface:ResultInterfaceCheck if this result has more rows to fetch.- Returns:
- true if it has
-
fetchNextRow
Fetch next row or null if none available.- Returns:
- next row or null
-
skipNextRow
protected boolean skipNextRow()Skip next row.- Returns:
- true if next row was available
-
getRowCount
public long getRowCount()Description copied from interface:ResultInterfaceGet the number of rows in this object.- Returns:
- the number of rows
-
isClosed
public boolean isClosed()Description copied from interface:ResultInterfaceCheck if this result set is closed.- Returns:
- true if it is
-
close
public void close()Description copied from interface:ResultInterfaceClose the result and delete any temporary files -
getAlias
Description copied from interface:ResultInterfaceGet the column alias name for the column.- Parameters:
i- the column number (starting with 0)- Returns:
- the alias name
-
getSchemaName
Description copied from interface:ResultInterfaceGet the schema name for the column, if one exists.- Parameters:
i- the column number (starting with 0)- Returns:
- the schema name or null
-
getTableName
Description copied from interface:ResultInterfaceGet the table name for the column, if one exists.- Parameters:
i- the column number (starting with 0)- Returns:
- the table name or null
-
getColumnName
Description copied from interface:ResultInterfaceGet the column name.- Parameters:
i- the column number (starting with 0)- Returns:
- the column name
-
getColumnType
Description copied from interface:ResultInterfaceGet the column data type.- Parameters:
i- the column number (starting with 0)- Returns:
- the column data type
-
isIdentity
public boolean isIdentity(int i) Description copied from interface:ResultInterfaceCheck if this is an identity column.- Parameters:
i- the column number (starting with 0)- Returns:
- true for identity columns
-
getNullable
public int getNullable(int i) Description copied from interface:ResultInterfaceCheck if this column is nullable.- Parameters:
i- the column number (starting with 0)- Returns:
- Column.NULLABLE_*
-
setFetchSize
public void setFetchSize(int fetchSize) Description copied from interface:ResultInterfaceSet the fetch size for this result set.- Parameters:
fetchSize- the new fetch size
-
getFetchSize
public int getFetchSize()Description copied from interface:ResultInterfaceGet the current fetch size for this result set.- Returns:
- the fetch size
-