Package org.h2.table

# Class DualTable

java.lang.Object
org.h2.engine.DbObject
org.h2.schema.SchemaObject
org.h2.table.Table
org.h2.table.VirtualTable
org.h2.table.DualTable

All Implemented Interfaces:
  `HasSQL`

public class DualTable extends VirtualTable
The DUAL table for selects without a FROM clause.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`NAME`
The name of the range table.

### Fields inherited from class org.h2.table.Table

`columns, compareMode, EXCLUSIVE_LOCK, READ_LOCK, TYPE_CACHED, TYPE_MEMORY, WRITE_LOCK`

### Fields inherited from class org.h2.engine.DbObject

`AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USER`

### Fields inherited from interface org.h2.util.HasSQL

`ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS`

## Constructor Summary

Constructors
Constructor
Description
`DualTable(Database database)`
Create a new range with the given start and end expressions.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canGetRowCount(SessionLocal session)`
Check if the row count can be retrieved quickly.
`long`
`getMaxDataModificationId()`
Get the last data modification id.
`long`
`getRowCount(SessionLocal session)`
Get the row count for this table.
`long`
`getRowCountApproximation(SessionLocal session)`
Get the approximated row count for this table.
`Index`
`getScanIndex(SessionLocal session)`
Get the scan index to iterate through all rows.
`StringBuilder`
`getSQL(StringBuilder builder, int sqlFlags)`
Appends the SQL statement of this object to the specified builder.
`TableType`
`getTableType()`
Get the table type name
`boolean`
`isDeterministic()`
Check if the table is deterministic.

### Methods inherited from class org.h2.table.VirtualTable

`addIndex, addRow, canDrop, canReference, checkRename, checkSupportAlter, close, getCreateSQL, getIndexes, isInsertable, removeRow, truncate`

### Methods inherited from class org.h2.table.Table

`addConstraint, addDependencies, addDependentMaterializedView, addDependentView, addSequence, addSynonym, addTrigger, canTruncate, checkDeadlock, checkWritingAllowed, compareValues, convertInsertRow, convertUpdateRow, createRow, doesColumnExist, dropMultipleColumnsConstraintsAndIndexes, findColumn, findPrimaryKey, fire, fireAfterRow, fireBeforeRow, fireRow, getBestPlanItem, getCheckForeignKeyConstraints, getChildren, getColumn, getColumn, getColumn, getColumns, getCompareMode, getConstraints, getDependentMaterializedViews, getDependentViews, getDiskSpaceUsed, getIdentityColumn, getIndex, getIndexForColumn, getMainIndexColumn, getNullRow, getOnCommitDrop, getOnCommitTruncate, getPrimaryKey, getRow, getRowFactory, getRowIdColumn, getScanIndex, getSQLTableType, getTemplateRow, getTemplateSimpleRow, getTriggers, getType, getVisibleColumns, hasSelectTrigger, isGlobalTemporary, isLockedExclusively, isLockedExclusivelyBy, isPersistData, isPersistIndexes, isQueryComparable, isRowLockable, isView, lock, lockRow, removeChildrenAndResources, removeColumnExpressionsDependencies, removeConstraint, removeDependentMaterializedView, removeDependentView, removeIndex, removeIndexOrTransferOwnership, removeSequence, removeSynonym, removeTrigger, rename, renameColumn, setCheckForeignKeyConstraints, setColumns, setOnCommitDrop, setOnCommitTruncate, unlock, updateRow, updateRows`

### Methods inherited from class org.h2.schema.SchemaObject

`getSchema, getSQL`

### Methods inherited from class org.h2.engine.DbObject

`getComment, getCreateSQLForCopy, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toString`

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

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

### Methods inherited from interface org.h2.util.HasSQL

`getTraceSQL`

## Field Details

### NAME

public static final String NAME
The name of the range table.

See Also:
  - Constant Field Values

## Constructor Details

### DualTable

public DualTable(Database database)
Create a new range with the given start and end expressions.

Parameters:
  `database` - the database

## Method Details

### getSQL

public StringBuilder getSQL(StringBuilder builder, int sqlFlags)
Description copied from interface: `HasSQL`
Appends the SQL statement of this object to the specified builder.

Specified by:
  `getSQL` in interface `HasSQL`
Overrides:
  `getSQL` in class `VirtualTable`
Parameters:
  `builder` - string builder
  `sqlFlags` - formatting flags
Returns:
  the specified string builder

### canGetRowCount

public boolean canGetRowCount(SessionLocal session)
Description copied from class: `Table`
Check if the row count can be retrieved quickly.

Specified by:
  `canGetRowCount` in class `Table`
Parameters:
  `session` - the session
Returns:
  true if it can

### getRowCount

public long getRowCount(SessionLocal session)
Description copied from class: `Table`
Get the row count for this table.

Specified by:
  `getRowCount` in class `Table`
Parameters:
  `session` - the session
Returns:
  the row count

### getTableType

public TableType getTableType()
Description copied from class: `Table`
Get the table type name

Overrides:
  `getTableType` in class `VirtualTable`
Returns:
  the table type name

### getScanIndex

public Index getScanIndex(SessionLocal session)
Description copied from class: `Table`
Get the scan index to iterate through all rows.

Specified by:
  `getScanIndex` in class `Table`
Parameters:
  `session` - the session
Returns:
  the index

### getMaxDataModificationId

public long getMaxDataModificationId()
Description copied from class: `Table`
Get the last data modification id.

Specified by:
  `getMaxDataModificationId` in class `Table`
Returns:
  the modification id

### getRowCountApproximation

public long getRowCountApproximation(SessionLocal session)
Description copied from class: `Table`
Get the approximated row count for this table.

Specified by:
  `getRowCountApproximation` in class `Table`
Parameters:
  `session` - the session
Returns:
  the approximated row count

### isDeterministic

public boolean isDeterministic()
Description copied from class: `Table`
Check if the table is deterministic.

Specified by:
  `isDeterministic` in class `Table`
Returns:
  true if it is