Top Description Fields Constructors Methods
org.h2.table

public abstract Class VirtualTable

extends Table
Class Inheritance
Known Direct Subclasses
org.h2.table.DualTable, org.h2.table.RangeTable, org.h2.table.VirtualConstructedTable
Imports
java.util.ArrayList, org.h2.engine.SessionLocal, org.h2.index.Index, .IndexType, org.h2.message.DbException, org.h2.result.Row, org.h2.schema.Schema, org.h2.util.ParserUtil

A base class for virtual tables.

Field Summary

Inherited from org.h2.table.Table:
columnscompareModeEXCLUSIVE_LOCKREAD_LOCKTYPE_CACHEDTYPE_MEMORYWRITE_LOCK

Constructor Summary

AccessConstructor and Description
protected
VirtualTable(Schema schema, int id, String name)

Method Summary

Modifier and TypeMethod and Description
public Index
addIndex(SessionLocal
the session
session
,
String
the name of the index
indexName
,
int
the id
indexId
,
IndexColumn[]
the index columns
cols
,
int
the count of unique columns
uniqueColumnCount
,
IndexType
the index type
indexType
,
boolean
whether this is a new index
create
,
String
the comment
indexComment
)

Implements abstract org.h2.table.Table.addIndex.

Create an index for this table

public void
addRow(SessionLocal
the session
session
,
Row
the row
row
)

Implements abstract org.h2.table.Table.addRow.

Add a row to the table and all indexes.

public boolean
canDrop()

Implements abstract org.h2.table.Table.canDrop.

Check if this table can be dropped.

public boolean
canReference()

Overrides org.h2.table.Table.canReference.

Check if this table can be referenced.

public void
checkRename()

Overrides org.h2.engine.DbObject.checkRename.

Check if renaming is allowed.

public void
checkSupportAlter()

Implements abstract org.h2.table.Table.checkSupportAlter.

Check if this table supports ALTER TABLE.

public void
close(SessionLocal
the session
session
)

Implements abstract org.h2.table.Table.close.

Close the table object and flush changes.

public String
getCreateSQL()

Implements abstract org.h2.engine.DbObject.getCreateSQL.

Construct the CREATE ...

public ArrayList<Index>
getIndexes()

Implements abstract org.h2.table.Table.getIndexes.

Get all indexes for this table.

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

Overrides org.h2.schema.SchemaObject.getSQL.

Implements org.h2.util.HasSQL.getSQL.

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

public TableType
getTableType()

Implements abstract org.h2.table.Table.getTableType.

Get the table type name

public boolean
isInsertable()

Overrides org.h2.table.Table.isInsertable.

Returns whether this table is insertable.

public void
removeRow(SessionLocal
the session
session
,
Row
the row
row
)

Implements abstract org.h2.table.Table.removeRow.

Remove a row from the table and all indexes.

public long
truncate(SessionLocal
the session
session
)

Implements abstract org.h2.table.Table.truncate.

Remove all rows from the table and indexes.

Inherited from org.h2.table.Table:
addConstraintaddDependenciesaddDependentMaterializedViewaddDependentViewaddSequenceaddSynonymaddTriggercanGetRowCountcanTruncatecheckDeadlockcheckWritingAllowedcompareValuesconvertInsertRowconvertUpdateRowcreateRowdoesColumnExistdropMultipleColumnsConstraintsAndIndexesfindColumnfindPrimaryKeyfirefireAfterRowfireBeforeRowfireRowgetBestPlanItemgetCheckForeignKeyConstraintsgetChildrengetColumngetColumngetColumngetColumnsgetCompareModegetConstraintsgetDependentMaterializedViewsgetDependentViewsgetDiskSpaceUsedgetIdentityColumngetIndexgetIndexForColumngetMainIndexColumngetMaxDataModificationIdgetNullRowgetOnCommitDropgetOnCommitTruncategetPrimaryKeygetRowgetRowCountgetRowCountApproximationgetRowFactorygetRowIdColumngetScanIndexgetScanIndexgetSQLTableTypegetTemplateRowgetTemplateSimpleRowgetTriggersgetTypegetVisibleColumnshasSelectTriggerisDeterministicisGlobalTemporaryisLockedExclusivelyisLockedExclusivelyByisPersistDataisPersistIndexesisQueryComparableisRowLockableisViewlocklockRowremoveChildrenAndResourcesremoveColumnExpressionsDependenciesremoveConstraintremoveDependentMaterializedViewremoveDependentViewremoveIndexremoveIndexOrTransferOwnershipremoveSequenceremoveSynonymremoveTriggerrenamerenameColumnsetCheckForeignKeyConstraintssetColumnssetOnCommitDropsetOnCommitTruncateunlockupdateRowupdateRows

Constructor Detail

VirtualTableback to summary
protected VirtualTable(Schema schema, int id, String name)

Method Detail

addIndexback to summary
public Index addIndex(SessionLocal session, String indexName, int indexId, IndexColumn[] cols, int uniqueColumnCount, IndexType indexType, boolean create, String indexComment)

Implements abstract org.h2.table.Table.addIndex.

Doc from org.h2.table.Table.addIndex.

Create an index for this table

Parameters
session:SessionLocal

the session

indexName:String

the name of the index

indexId:int

the id

cols:IndexColumn[]

the index columns

uniqueColumnCount:int

the count of unique columns

indexType:IndexType

the index type

create:boolean

whether this is a new index

indexComment:String

the comment

Returns:Index

the index

Annotations
@Override
addRowback to summary
public void addRow(SessionLocal session, Row row)

Implements abstract org.h2.table.Table.addRow.

Doc from org.h2.table.Table.addRow.

Add a row to the table and all indexes.

Parameters
session:SessionLocal

the session

row:Row

the row

Annotations
@Override
canDropback to summary
public boolean canDrop()

Implements abstract org.h2.table.Table.canDrop.

Doc from org.h2.table.Table.canDrop.

Check if this table can be dropped.

Returns:boolean

true if it can

Annotations
@Override
canReferenceback to summary
public boolean canReference()

Overrides org.h2.table.Table.canReference.

Doc from org.h2.table.Table.canReference.

Check if this table can be referenced.

Returns:boolean

true if it can

Annotations
@Override
checkRenameback to summary
public void checkRename()

Overrides org.h2.engine.DbObject.checkRename.

Doc from org.h2.engine.DbObject.checkRename.

Check if renaming is allowed. Does nothing when allowed.

Annotations
@Override
checkSupportAlterback to summary
public void checkSupportAlter()

Implements abstract org.h2.table.Table.checkSupportAlter.

Doc from org.h2.table.Table.checkSupportAlter.

Check if this table supports ALTER TABLE.

Annotations
@Override
closeback to summary
public void close(SessionLocal session)

Implements abstract org.h2.table.Table.close.

Doc from org.h2.table.Table.close.

Close the table object and flush changes.

Parameters
session:SessionLocal

the session

Annotations
@Override
getCreateSQLback to summary
public String getCreateSQL()

Implements abstract org.h2.engine.DbObject.getCreateSQL.

Doc from org.h2.engine.DbObject.getCreateSQL.

Construct the CREATE ... SQL statement for this object.

Returns:String

the SQL statement

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

Implements abstract org.h2.table.Table.getIndexes.

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

Get all indexes for this table.

Returns:ArrayList<Index>

the list of indexes

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

Overrides org.h2.schema.SchemaObject.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
getTableTypeback to summary
public TableType getTableType()

Implements abstract org.h2.table.Table.getTableType.

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

Get the table type name

Returns:TableType

the table type name

Annotations
@Override
isInsertableback to summary
public boolean isInsertable()

Overrides org.h2.table.Table.isInsertable.

Doc from org.h2.table.Table.isInsertable.

Returns whether this table is insertable.

Returns:boolean

whether this table is insertable

Annotations
@Override
removeRowback to summary
public void removeRow(SessionLocal session, Row row)

Implements abstract org.h2.table.Table.removeRow.

Doc from org.h2.table.Table.removeRow.

Remove a row from the table and all indexes.

Parameters
session:SessionLocal

the session

row:Row

the row

Annotations
@Override
truncateback to summary
public long truncate(SessionLocal session)

Implements abstract org.h2.table.Table.truncate.

Doc from org.h2.table.Table.truncate.

Remove all rows from the table and indexes.

Parameters
session:SessionLocal

the session

Returns:long

number of removed rows, possibly including uncommitted rows

Annotations
@Override