Package org.h2.mvstore.db

# Class MVTempResult

java.lang.Object
org.h2.mvstore.db.MVTempResult

All Implemented Interfaces:
  `ResultExternal`

public abstract class MVTempResult extends Object implements ResultExternal
Temporary result.

A separate MVStore in a temporary file is used for each result. The file is removed when this result and all its copies are closed. `TempFileDeleter` is also used to delete this file if results are not closed properly.

## Method Summary

Modifier and Type
Method
Description
`int`
`addRows(Collection<Value[]> rows)`
Add a number of rows to the result.
`void`
`close()`
Close this object and delete the temporary file.
`static ResultExternal`
`of(Database database, Expression[] expressions, boolean distinct, int[] distinctIndexes, int visibleColumnCount, int resultColumnCount, SortOrder sort)`
Creates MVStore-based temporary result.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.h2.result.ResultExternal

`addRow, contains, createShallowCopy, next, removeRow, reset`

## Method Details

### of

public static ResultExternal of(Database database, Expression[] expressions, boolean distinct, int[] distinctIndexes, int visibleColumnCount, int resultColumnCount, SortOrder sort)
Creates MVStore-based temporary result.

Parameters:
  `database` - database
  `expressions` - expressions
  `distinct` - is output distinct
  `distinctIndexes` - indexes of distinct columns for DISTINCT ON results
  `visibleColumnCount` - count of visible columns
  `resultColumnCount` - the number of columns including visible columns and additional virtual columns for ORDER BY and DISTINCT ON clauses
  `sort` - sort order, or `null`
Returns:
  temporary result

### addRows

public int addRows(Collection<Value[]> rows)
Description copied from interface: `ResultExternal`
Add a number of rows to the result.

Specified by:
  `addRows` in interface `ResultExternal`
Parameters:
  `rows` - the list of rows to add
Returns:
  the new number of rows in this object

### close

public void close()
Description copied from interface: `ResultExternal`
Close this object and delete the temporary file.

Specified by:
  `close` in interface `ResultExternal`