public final class TableView extends QueryExpressionTable
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| 构造器和说明 |
|---|
TableView(Schema schema,
int id,
String name,
String querySQL,
ArrayList<Parameter> params,
Column[] columnTemplates,
SessionLocal session,
boolean allowRecursive,
boolean literalsChecked,
boolean isTableExpression,
boolean isTemporary) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
canDrop()
Check if this table can be dropped.
|
static void |
clearIndexCaches(Database database)
Clear the cached indexes for all sessions.
|
static Table |
createShadowTableForRecursiveTableExpression(boolean isTemporary,
SessionLocal targetSession,
String cteViewName,
Schema schema,
List<Column> columns,
Database db)
Create a table for a recursive query.
|
static TableView |
createTableViewMaybeRecursive(Schema schema,
int id,
String name,
String querySQL,
ArrayList<Parameter> parameters,
Column[] columnTemplates,
SessionLocal session,
boolean literalsChecked,
boolean isTableExpression,
boolean isTemporary,
Database db)
Create a view.
|
static void |
destroyShadowTableForRecursiveExpression(boolean isTemporary,
SessionLocal targetSession,
Table recursiveTable)
Remove a table for a recursive query.
|
String |
getCreateSQL()
Construct the CREATE ...
|
String |
getCreateSQL(boolean orReplace,
boolean force)
Generate "CREATE" SQL statement for the view.
|
String |
getCreateSQLForCopy(Table table,
String quotedName)
Build a SQL statement to re-create the object, or to create a copy of the
object with a different name or referencing a different table
|
String |
getDropSQL()
Construct a DROP ...
|
long |
getMaxDataModificationId()
Get the last data modification id.
|
String |
getQuerySQL() |
ResultInterface |
getRecursiveResult() |
Index |
getScanIndex(SessionLocal session,
int[] masks,
TableFilter[] filters,
int filter,
SortOrder sortOrder,
AllColumnsForPlan allColumnsSet)
Get the scan index for this table.
|
StringBuilder |
getSQL(StringBuilder builder,
int sqlFlags)
Appends the SQL statement of this object to the specified builder.
|
List<Table> |
getTables() |
TableType |
getTableType()
Get the table type name
|
Query |
getTopQuery() |
boolean |
isDeterministic()
Check if the table is deterministic.
|
boolean |
isInvalid()
Check if this view is currently invalid.
|
boolean |
isRecursive() |
boolean |
isRecursiveQueryDetected()
Was query recursion detected during compiling.
|
DbException |
recompile(SessionLocal session,
boolean force,
boolean clearIndexCache)
Re-compile the view query and all views that depend on this object.
|
void |
removeChildrenAndResources(SessionLocal session)
Delete all dependent children objects and resources of this object.
|
void |
replace(String querySQL,
Column[] newColumnTemplates,
SessionLocal session,
boolean recursive,
boolean force,
boolean literalsChecked)
Try to replace the SQL statement of the view and re-compile this and all
dependent views.
|
void |
setRecursiveResult(ResultInterface value) |
addDependencies, addIndex, addRow, canGetRowCount, canReference, checkSupportAlter, close, createQueryColumnTemplateList, getBestPlanItem, getIndexes, getParameterOffset, getQuery, getRowCount, getRowCountApproximation, getScanIndex, isInsertable, isQueryComparable, isView, removeRow, truncateaddConstraint, addDependentView, addSequence, addSynonym, addTrigger, canTruncate, checkDeadlock, checkWritingAllowed, compareValues, convertInsertRow, convertUpdateRow, createRow, doesColumnExist, dropMultipleColumnsConstraintsAndIndexes, findColumn, findPrimaryKey, fire, fireAfterRow, fireBeforeRow, fireRow, getCheckForeignKeyConstraints, getChildren, getColumn, getColumn, getColumn, getColumns, getCompareMode, getConstraints, getDependentViews, getDiskSpaceUsed, getIdentityColumn, getIndex, getIndexForColumn, getMainIndexColumn, getNullRow, getOnCommitDrop, getOnCommitTruncate, getPrimaryKey, getRow, getRowFactory, getRowIdColumn, getSQLTableType, getTemplateRow, getTemplateSimpleRow, getTriggers, getType, hasSelectTrigger, isGlobalTemporary, isHidden, isLockedExclusively, isLockedExclusivelyBy, isPersistData, isPersistIndexes, isRowLockable, isTableExpression, lock, lockRow, removeColumnExpressionsDependencies, removeConstraint, removeDependentView, removeIndex, removeIndexOrTransferOwnership, removeSequence, removeSynonym, removeTrigger, rename, renameColumn, setCheckForeignKeyConstraints, setColumns, setHidden, setOnCommitDrop, setOnCommitTruncate, setTableExpression, unlock, updateRow, updateRowsgetSchema, getSQLcheckRename, getComment, getCreateSQLForMeta, getDatabase, getId, getModificationId, getName, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLpublic void replace(String querySQL, Column[] newColumnTemplates, SessionLocal session, boolean recursive, boolean force, boolean literalsChecked)
querySQL - the SQL statementnewColumnTemplates - the columnssession - the sessionrecursive - whether this is a recursive viewforce - if errors should be ignoredliteralsChecked - if literals have been checkedpublic DbException recompile(SessionLocal session, boolean force, boolean clearIndexCache)
session - the sessionforce - if exceptions should be ignoredclearIndexCache - if we need to clear view index cachepublic boolean isInvalid()
public Query getTopQuery()
getTopQuery 在类中 QueryExpressionTablepublic String getDropSQL()
DbObjectgetDropSQL 在类中 DbObjectpublic String getCreateSQLForCopy(Table table, String quotedName)
DbObjectgetCreateSQLForCopy 在类中 DbObjecttable - the new tablequotedName - the quoted namepublic String getCreateSQL()
DbObjectgetCreateSQL 在类中 DbObjectpublic String getCreateSQL(boolean orReplace, boolean force)
orReplace - if true, then include the OR REPLACE clauseforce - if true, then include the FORCE clausepublic boolean canDrop()
Tablepublic TableType getTableType()
TablegetTableType 在类中 Tablepublic void removeChildrenAndResources(SessionLocal session)
DbObjectremoveChildrenAndResources 在类中 Tablesession - the sessionpublic static void clearIndexCaches(Database database)
database - the databasepublic StringBuilder getSQL(StringBuilder builder, int sqlFlags)
HasSQLgetSQL 在接口中 HasSQLgetSQL 在类中 SchemaObjectbuilder - string buildersqlFlags - formatting flagspublic String getQuerySQL()
public Index getScanIndex(SessionLocal session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, AllColumnsForPlan allColumnsSet)
TablegetScanIndex 在类中 QueryExpressionTablesession - the sessionmasks - the search maskfilters - the table filtersfilter - the filter indexsortOrder - the sort orderallColumnsSet - all columnspublic long getMaxDataModificationId()
TablegetMaxDataModificationId 在类中 QueryExpressionTablepublic boolean isRecursive()
public boolean isDeterministic()
TableisDeterministic 在类中 QueryExpressionTablepublic void setRecursiveResult(ResultInterface value)
public ResultInterface getRecursiveResult()
public boolean isRecursiveQueryDetected()
public static TableView createTableViewMaybeRecursive(Schema schema, int id, String name, String querySQL, ArrayList<Parameter> parameters, Column[] columnTemplates, SessionLocal session, boolean literalsChecked, boolean isTableExpression, boolean isTemporary, Database db)
schema - the schemaid - the view idname - the view namequerySQL - the queryparameters - the parameterscolumnTemplates - the columnssession - the sessionliteralsChecked - whether literals in the query are checkedisTableExpression - if this is a table expressionisTemporary - whether the view is persisteddb - the databasepublic static Table createShadowTableForRecursiveTableExpression(boolean isTemporary, SessionLocal targetSession, String cteViewName, Schema schema, List<Column> columns, Database db)
isTemporary - whether the table is persistedtargetSession - the sessioncteViewName - the nameschema - the schemacolumns - the columnsdb - the databasepublic static void destroyShadowTableForRecursiveExpression(boolean isTemporary,
SessionLocal targetSession,
Table recursiveTable)
isTemporary - whether the table is persistedtargetSession - the sessionrecursiveTable - the tableCopyright © 2022. All rights reserved.