Top Description Fields Constructors Methods
org.h2.table

public Class RangeTable

extends VirtualTable
Class Inheritance
Imports
java.util.ArrayList, org.h2.api.ErrorCode, org.h2.engine.SessionLocal, org.h2.expression.Expression, org.h2.index.Index, .RangeIndex, org.h2.message.DbException, org.h2.schema.Schema, org.h2.value.TypeInfo

The table SYSTEM_RANGE is a virtual table that generates incrementing numbers with a given start end point.

Field Summary

Modifier and TypeField and Description
public static final String
ALIAS

The PostgreSQL alias for the range table.

private final RangeIndex
private Expression
private Expression
public static final String
NAME

The name of the range table.

private boolean
private Expression

Constructor Summary

AccessConstructor and Description
public
RangeTable(Schema
the schema (always the main schema)
schema
,
Expression
the start expression
min
,
Expression
the end expression
max
)

Create a new range with the given start and end expressions.

public

Method Summary

Modifier and TypeMethod and Description
public boolean
canGetRowCount(SessionLocal
the session
session
)

Implements abstract org.h2.table.Table.canGetRowCount.

Check if the row count can be retrieved quickly.

public ArrayList<Index>
getIndexes()

Overrides org.h2.table.VirtualTable.getIndexes.

Get all indexes for this table.

public long

Returns:

the end value
getMax
(SessionLocal
the session
session
)

Calculate and get the end value of this range.

public long
getMaxDataModificationId()

Implements abstract org.h2.table.Table.getMaxDataModificationId.

Get the last data modification id.

public long

Returns:

the start value
getMin
(SessionLocal
the session
session
)

Calculate and get the start value of this range.

public long
getRowCount(SessionLocal
the session
session
)

Implements abstract org.h2.table.Table.getRowCount.

Get the row count for this table.

public long
getRowCountApproximation(SessionLocal
the session
session
)

Implements abstract org.h2.table.Table.getRowCountApproximation.

Get the approximated row count for this table.

public Index
getScanIndex(SessionLocal
the session
session
)

Implements abstract org.h2.table.Table.getScanIndex.

Get the scan index to iterate through all rows.

public StringBuilder
getSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Overrides org.h2.table.VirtualTable.getSQL.

Implements org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

public long

Returns:

the increment (1 by default)
getStep
(SessionLocal
the session
session
)

Get the increment.

public TableType
getTableType()

Overrides org.h2.table.VirtualTable.getTableType.

Get the table type name

public boolean
isDeterministic()

Implements abstract org.h2.table.Table.isDeterministic.

Check if the table is deterministic.

private void
Inherited from org.h2.table.VirtualTable:
addIndexaddRowcanDropcanReferencecheckRenamecheckSupportAlterclosegetCreateSQLisInsertableremoveRowtruncate

Field Detail

ALIASback to summary
public static final String ALIAS

The PostgreSQL alias for the range table.

indexback to summary
private final RangeIndex index
maxback to summary
private Expression max
minback to summary
private Expression min
NAMEback to summary
public static final String NAME

The name of the range table.

optimizedback to summary
private boolean optimized
stepback to summary
private Expression step

Constructor Detail

RangeTableback to summary
public RangeTable(Schema schema, Expression min, Expression max)

Create a new range with the given start and end expressions.

Parameters
schema:Schema

the schema (always the main schema)

min:Expression

the start expression

max:Expression

the end expression

RangeTableback to summary
public RangeTable(Schema schema, Expression min, Expression max, Expression step)

Method Detail

canGetRowCountback to summary
public boolean canGetRowCount(SessionLocal session)

Implements abstract org.h2.table.Table.canGetRowCount.

Doc from org.h2.table.Table.canGetRowCount.

Check if the row count can be retrieved quickly.

Parameters
session:SessionLocal

the session

Returns:boolean

true if it can

Annotations
@Override
getIndexesback to summary
public ArrayList<Index> getIndexes()

Overrides org.h2.table.VirtualTable.getIndexes.

Doc from org.h2.table.Table.getIndexes.

Get all indexes for this table.

Returns:ArrayList<Index>

the list of indexes

Annotations
@Override
getMaxback to summary
public long getMax(SessionLocal session)

Calculate and get the end value of this range.

Parameters
session:SessionLocal

the session

Returns:long

the end value

getMaxDataModificationIdback to summary
public long getMaxDataModificationId()

Implements abstract org.h2.table.Table.getMaxDataModificationId.

Doc from org.h2.table.Table.getMaxDataModificationId.

Get the last data modification id.

Returns:long

the modification id

Annotations
@Override
getMinback to summary
public long getMin(SessionLocal session)

Calculate and get the start value of this range.

Parameters
session:SessionLocal

the session

Returns:long

the start value

getRowCountback to summary
public long getRowCount(SessionLocal session)

Implements abstract org.h2.table.Table.getRowCount.

Doc from org.h2.table.Table.getRowCount.

Get the row count for this table.

Parameters
session:SessionLocal

the session

Returns:long

the row count

Annotations
@Override
getRowCountApproximationback to summary
public long getRowCountApproximation(SessionLocal session)

Implements abstract org.h2.table.Table.getRowCountApproximation.

Doc from org.h2.table.Table.getRowCountApproximation.

Get the approximated row count for this table.

Parameters
session:SessionLocal

the session

Returns:long

the approximated row count

Annotations
@Override
getScanIndexback to summary
public Index getScanIndex(SessionLocal session)

Implements abstract org.h2.table.Table.getScanIndex.

Doc from org.h2.table.Table.getScanIndex.

Get the scan index to iterate through all rows.

Parameters
session:SessionLocal

the session

Returns:Index

the index

Annotations
@Override
getSQLback to summary
public StringBuilder getSQL(StringBuilder builder, int sqlFlags)

Overrides org.h2.table.VirtualTable.getSQL.

Implements org.h2.util.HasSQL.getSQL.

Doc from org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

Annotations
@Override
getStepback to summary
public long getStep(SessionLocal session)

Get the increment.

Parameters
session:SessionLocal

the session

Returns:long

the increment (1 by default)

getTableTypeback to summary
public TableType getTableType()

Overrides org.h2.table.VirtualTable.getTableType.

Doc from org.h2.table.Table.getTableType.

Get the table type name

Returns:TableType

the table type name

Annotations
@Override
isDeterministicback to summary
public boolean isDeterministic()

Implements abstract org.h2.table.Table.isDeterministic.

Doc from org.h2.table.Table.isDeterministic.

Check if the table is deterministic.

Returns:boolean

true if it is

Annotations
@Override
optimizeback to summary
private void optimize(SessionLocal s)