public abstract class MetaTable extends Table
| Modifier and Type | Field and Description |
|---|---|
protected int |
indexColumn
The indexed column.
|
protected MetaIndex |
metaIndex
The index for this table.
|
static long |
ROW_COUNT_APPROXIMATION
The approximate number of rows of a meta table.
|
protected int |
type
The table type.
|
columns, compareMode, EXCLUSIVE_LOCK, isHidden, READ_LOCK, TYPE_CACHED, TYPE_MEMORY, WRITE_LOCKAGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USERADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS| Modifier | Constructor and Description |
|---|---|
protected |
MetaTable(Schema schema,
int id,
int type)
Create a new metadata table.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
add(SessionLocal session,
java.util.ArrayList<Row> rows,
java.lang.Object... stringsOrValues)
Add a row to a list.
|
Index |
addIndex(SessionLocal session,
java.lang.String indexName,
int indexId,
IndexColumn[] cols,
int uniqueColumnCount,
IndexType indexType,
boolean create,
java.lang.String indexComment)
Create an index for this table
|
void |
addRow(SessionLocal session,
Row row)
Add a row to the table and all indexes.
|
boolean |
canDrop()
Check if this table can be dropped.
|
boolean |
canGetRowCount(SessionLocal session)
Check if the row count can be retrieved quickly.
|
boolean |
canReference()
Check if this table can be referenced.
|
protected boolean |
checkIndex(SessionLocal session,
java.lang.String value,
Value indexFrom,
Value indexTo)
Checks index conditions.
|
void |
checkRename()
Check if renaming is allowed.
|
void |
checkSupportAlter()
Check if this table supports ALTER TABLE.
|
void |
close(SessionLocal session)
Close the table object and flush changes.
|
protected Column |
column(java.lang.String name,
TypeInfo type)
Creates a column with the specified name and data type.
|
abstract java.util.ArrayList<Row> |
generateRows(SessionLocal session,
SearchRow first,
SearchRow last)
Generate the data for the given metadata table using the given first and
last row filters.
|
java.lang.String |
getCreateSQL()
Construct the CREATE ...
|
java.util.ArrayList<Index> |
getIndexes()
Get all indexes for this table.
|
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.
|
TableType |
getTableType()
Get the table type name
|
protected boolean |
hideTable(Table table,
SessionLocal session)
Check whether to hide the table.
|
protected java.lang.String |
identifier(java.lang.String s)
If needed, convert the identifier to lower case.
|
boolean |
isDeterministic()
Check if the table is deterministic.
|
boolean |
isInsertable()
Returns whether this table is insertable.
|
void |
removeChildrenAndResources(SessionLocal session)
Delete all dependent children objects and resources of this object.
|
void |
removeRow(SessionLocal session,
Row row)
Remove a row from the table and all indexes.
|
protected void |
setMetaTableName(java.lang.String upperName) |
long |
truncate(SessionLocal session)
Remove all rows from the table and indexes.
|
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, getMaxDataModificationId, getNullRow, getOnCommitDrop, getOnCommitTruncate, getPrimaryKey, getRow, getRowFactory, getRowIdColumn, getScanIndex, getSQLTableType, getTemplateRow, getTemplateSimpleRow, getTriggers, getType, hasSelectTrigger, isGlobalTemporary, isHidden, isLockedExclusively, isLockedExclusivelyBy, isPersistData, isPersistIndexes, isQueryComparable, isRowLockable, isTableExpression, isView, lock, lockRow, removeColumnExpressionsDependencies, removeConstraint, removeDependentMaterializedView, removeDependentView, removeIndex, removeIndexOrTransferOwnership, removeSequence, removeSynonym, removeTrigger, rename, renameColumn, setCheckForeignKeyConstraints, setColumns, setHidden, setOnCommitDrop, setOnCommitTruncate, setTableExpression, unlock, updateRow, updateRowsgetSchema, getSQL, getSQLgetComment, getCreateSQLForCopy, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLpublic static final long ROW_COUNT_APPROXIMATION
protected final int type
protected int indexColumn
protected MetaIndex metaIndex
protected MetaTable(Schema schema, int id, int type)
schema - the schemaid - the object idtype - the meta table typeprotected final void setMetaTableName(java.lang.String upperName)
protected final Column column(java.lang.String name, TypeInfo type)
name - the uppercase column nametype - the data typepublic final java.lang.String getCreateSQL()
DbObjectgetCreateSQL in class DbObjectpublic final Index addIndex(SessionLocal session, java.lang.String indexName, int indexId, IndexColumn[] cols, int uniqueColumnCount, IndexType indexType, boolean create, java.lang.String indexComment)
TableaddIndex in class Tablesession - the sessionindexName - the name of the indexindexId - the idcols - the index columnsuniqueColumnCount - the count of unique columnsindexType - the index typecreate - whether this is a new indexindexComment - the commentprotected final java.lang.String identifier(java.lang.String s)
s - the identifier to convertprotected final boolean checkIndex(SessionLocal session, java.lang.String value, Value indexFrom, Value indexTo)
session - the sessionvalue - the valueindexFrom - the lower bound of value, or nullindexTo - the higher bound of value, or nullprotected final boolean hideTable(Table table, SessionLocal session)
table - the tablesession - the sessionpublic abstract java.util.ArrayList<Row> generateRows(SessionLocal session, SearchRow first, SearchRow last)
session - the sessionfirst - the first row to returnlast - the last row to returnpublic boolean isInsertable()
TableisInsertable in class Tablepublic final void removeRow(SessionLocal session, Row row)
Tablepublic final void addRow(SessionLocal session, Row row)
Tablepublic final void removeChildrenAndResources(SessionLocal session)
DbObjectremoveChildrenAndResources in class Tablesession - the sessionpublic final void close(SessionLocal session)
Tableprotected final void add(SessionLocal session, java.util.ArrayList<Row> rows, java.lang.Object... stringsOrValues)
session - the sessionrows - the original row liststringsOrValues - the values, or stringspublic final void checkRename()
DbObjectcheckRename in class DbObjectpublic final void checkSupportAlter()
TablecheckSupportAlter in class Tablepublic final long truncate(SessionLocal session)
Tablepublic long getRowCount(SessionLocal session)
TablegetRowCount in class Tablesession - the sessionpublic boolean canGetRowCount(SessionLocal session)
TablecanGetRowCount in class Tablesession - the sessionpublic final boolean canDrop()
Tablepublic final TableType getTableType()
TablegetTableType in class Tablepublic final Index getScanIndex(SessionLocal session)
TablegetScanIndex in class Tablesession - the sessionpublic final java.util.ArrayList<Index> getIndexes()
TablegetIndexes in class Tablepublic long getRowCountApproximation(SessionLocal session)
TablegetRowCountApproximation in class Tablesession - the sessionpublic final boolean isDeterministic()
TableisDeterministic in class Tablepublic final boolean canReference()
TablecanReference in class Table