Package org.h2.table
Class RangeTable
java.lang.Object
org.h2.engine.DbObject
org.h2.schema.SchemaObject
org.h2.table.Table
org.h2.table.VirtualTable
org.h2.table.RangeTable
- All Implemented Interfaces:
HasSQL
The table SYSTEM_RANGE is a virtual table that generates incrementing numbers
with a given start end point.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe PostgreSQL alias for the range table.static final StringThe name of the range table.Fields inherited from class org.h2.table.Table
columns, compareMode, EXCLUSIVE_LOCK, READ_LOCK, TYPE_CACHED, TYPE_MEMORY, WRITE_LOCKFields 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, USERFields 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
ConstructorsConstructorDescriptionRangeTable(Schema schema, Expression min, Expression max) Create a new range with the given start and end expressions.RangeTable(Schema schema, Expression min, Expression max, Expression step) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanGetRowCount(SessionLocal session) Check if the row count can be retrieved quickly.Get all indexes for this table.longgetMax(SessionLocal session) Calculate and get the end value of this range.longGet the last data modification id.longgetMin(SessionLocal session) Calculate and get the start value of this range.longgetRowCount(SessionLocal session) Get the row count for this table.longgetRowCountApproximation(SessionLocal session) Get the approximated row count for this table.getScanIndex(SessionLocal session) Get the scan index to iterate through all rows.getSQL(StringBuilder builder, int sqlFlags) Appends the SQL statement of this object to the specified builder.longgetStep(SessionLocal session) Get the increment.Get the table type namebooleanCheck if the table is deterministic.Methods inherited from class org.h2.table.VirtualTable
addIndex, addRow, canDrop, canReference, checkRename, checkSupportAlter, close, getCreateSQL, isInsertable, removeRow, truncateMethods 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, updateRowsMethods inherited from class org.h2.schema.SchemaObject
getSchema, getSQLMethods inherited from class org.h2.engine.DbObject
equals, getComment, getCreateSQLForCopy, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, hashCode, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.h2.util.HasSQL
getTraceSQL
-
Field Details
-
NAME
The name of the range table.- See Also:
-
ALIAS
The PostgreSQL alias for the range table.- See Also:
-
-
Constructor Details
-
RangeTable
Create a new range with the given start and end expressions.- Parameters:
schema- the schema (always the main schema)min- the start expressionmax- the end expression
-
RangeTable
-
-
Method Details
-
getSQL
Description copied from interface:HasSQLAppends the SQL statement of this object to the specified builder.- Specified by:
getSQLin interfaceHasSQL- Overrides:
getSQLin classVirtualTable- Parameters:
builder- string buildersqlFlags- formatting flags- Returns:
- the specified string builder
-
canGetRowCount
Description copied from class:TableCheck if the row count can be retrieved quickly.- Specified by:
canGetRowCountin classTable- Parameters:
session- the session- Returns:
- true if it can
-
getRowCount
Description copied from class:TableGet the row count for this table.- Specified by:
getRowCountin classTable- Parameters:
session- the session- Returns:
- the row count
-
getTableType
Description copied from class:TableGet the table type name- Overrides:
getTableTypein classVirtualTable- Returns:
- the table type name
-
getScanIndex
Description copied from class:TableGet the scan index to iterate through all rows.- Specified by:
getScanIndexin classTable- Parameters:
session- the session- Returns:
- the index
-
getIndexes
Description copied from class:TableGet all indexes for this table.- Overrides:
getIndexesin classVirtualTable- Returns:
- the list of indexes
-
getMin
Calculate and get the start value of this range.- Parameters:
session- the session- Returns:
- the start value
-
getMax
Calculate and get the end value of this range.- Parameters:
session- the session- Returns:
- the end value
-
getStep
Get the increment.- Parameters:
session- the session- Returns:
- the increment (1 by default)
-
getMaxDataModificationId
public long getMaxDataModificationId()Description copied from class:TableGet the last data modification id.- Specified by:
getMaxDataModificationIdin classTable- Returns:
- the modification id
-
getRowCountApproximation
Description copied from class:TableGet the approximated row count for this table.- Specified by:
getRowCountApproximationin classTable- Parameters:
session- the session- Returns:
- the approximated row count
-
isDeterministic
public boolean isDeterministic()Description copied from class:TableCheck if the table is deterministic.- Specified by:
isDeterministicin classTable- Returns:
- true if it is
-