public class TableView extends Table
columns, compareMode, isHidden, TYPE_CACHED, TYPE_MEMORYcomment, database, traceAGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE| 构造器和说明 |
|---|
TableView(Schema schema,
int id,
String name,
String querySQL,
ArrayList<Parameter> params,
Column[] columnTemplates,
Session session,
boolean recursive) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addDependencies(HashSet<DbObject> dependencies)
Add all objects that this table depends on to the hash set.
|
Index |
addIndex(Session session,
String indexName,
int indexId,
IndexColumn[] cols,
IndexType indexType,
boolean create,
String indexComment)
Create an index for this table
|
void |
addRow(Session session,
Row row)
Add a row to the table and all indexes.
|
boolean |
canDrop()
Check if this table can be dropped.
|
boolean |
canGetRowCount()
Check if the row count can be retrieved quickly.
|
boolean |
canReference()
Check if this table can be referenced.
|
void |
checkRename()
Check if this object can be renamed.
|
void |
checkSupportAlter()
Check if this table supports ALTER TABLE.
|
static void |
clearIndexCaches(Database database)
Clear the cached indexes for all sessions.
|
void |
close(Session session)
Close the table object and flush changes.
|
static TableView |
createTempView(Session session,
User owner,
String name,
Query query,
Query topQuery)
Create a temporary view out of the given query.
|
PlanItem |
getBestPlanItem(Session session,
int[] masks,
TableFilter[] filters,
int filter,
SortOrder sortOrder,
HashSet<Column> allColumnsSet)
Get the best plan for the given search mask.
|
String |
getCreateSQL()
Build a SQL statement to re-create this object.
|
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
|
long |
getDiskSpaceUsed() |
String |
getDropSQL()
Build a SQL statement to drop this object.
|
ArrayList<Index> |
getIndexes()
Get all indexes for this table.
|
long |
getMaxDataModificationId()
Get the last data modification id.
|
User |
getOwner() |
int |
getParameterOffset(ArrayList<Parameter> additionalParameters)
Get the index of the first parameter.
|
String |
getQuery() |
LocalResult |
getRecursiveResult() |
long |
getRowCount(Session session)
Get the row count for this table.
|
long |
getRowCountApproximation()
Get the approximated row count for this table.
|
Index |
getScanIndex(Session session)
Get the scan index to iterate through all rows.
|
Index |
getScanIndex(Session session,
int[] masks,
TableFilter[] filters,
int filter,
SortOrder sortOrder,
HashSet<Column> allColumnsSet)
Get the scan index for this table.
|
String |
getSQL()
Get the SQL name of this object (may be quoted).
|
TableType |
getTableType()
Get the table type name
|
Query |
getTopQuery() |
Index |
getUniqueIndex()
Get any unique index for this table if one exists.
|
boolean |
isDeterministic()
Check if the table is deterministic.
|
boolean |
isInvalid()
Check if this view is currently invalid.
|
boolean |
isLockedExclusively()
Check if this table is locked exclusively.
|
boolean |
isQueryComparable()
Check whether the table (or view) contains no columns that prevent index
conditions to be used.
|
boolean |
isRecursive() |
boolean |
isTableExpression() |
boolean |
isView() |
boolean |
lock(Session session,
boolean exclusive,
boolean forceLockEvenInMvcc)
Lock the table for the given session.
|
DbException |
recompile(Session session,
boolean force,
boolean clearIndexCache)
Re-compile the view query and all views that depend on this object.
|
void |
removeChildrenAndResources(Session session)
Remove all dependent objects and free all resources (files, blocks in
files) of this object.
|
void |
removeRow(Session session,
Row row)
Remove a row from the table and all indexes.
|
void |
replace(String querySQL,
String[] columnNames,
Session session,
boolean recursive,
boolean force)
Try to replace the SQL statement of the view and re-compile this and all
dependent views.
|
void |
setRecursiveResult(LocalResult value) |
void |
setTableExpression(boolean tableExpression) |
void |
truncate(Session session)
Remove all rows from the table and indexes.
|
void |
unlock(Session s)
Release the lock for this session.
|
addConstraint, addSequence, addTrigger, addView, canTruncate, checkDeadlock, checkWritingAllowed, commit, compareTypeSafe, doesColumnExist, dropMultipleColumnsConstraintsAndIndexes, findPrimaryKey, fire, fireAfterRow, fireBeforeRow, fireRow, getCheckForeignKeyConstraints, getChildren, getColumn, getColumn, getColumns, getCompareMode, getConstraints, getDefaultValue, getIndexForColumn, getOnCommitDrop, getOnCommitTruncate, getPrimaryKey, getRow, getRowIdColumn, getTemplateRow, getTemplateSimpleRow, getType, getViews, hasSelectTrigger, isGlobalTemporary, isHidden, isLockedExclusivelyBy, isMVStore, isPersistData, isPersistIndexes, removeConstraint, removeIndex, removeIndexOrTransferOwnership, removeSequence, removeTrigger, removeView, rename, renameColumn, setCheckForeignKeyConstraints, setColumns, setHidden, setOnCommitDrop, setOnCommitTruncate, updateRows, validateConvertUpdateSequencegetSchema, initSchemaObjectBasegetComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComment, getDatabase, getId, getName, isTemporary, setComment, setTemporarypublic void replace(String querySQL, String[] columnNames, Session session, boolean recursive, boolean force)
querySQL - the SQL statementcolumnNames - the column namessession - the sessionrecursive - whether this is a recursive viewforce - if errors should be ignoredpublic DbException recompile(Session session, boolean force, boolean clearIndexCache)
session - the sessionforce - if exceptions should be ignoredclearIndexCache - if we need to clear view index cachepublic boolean isInvalid()
public PlanItem getBestPlanItem(Session session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, HashSet<Column> allColumnsSet)
TablegetBestPlanItem 在类中 Tablesession - the sessionmasks - per-column comparison bit masks, null means 'always false',
see constants in IndexConditionfilters - all joined table filtersfilter - the current table filter indexsortOrder - the sort orderallColumnsSet - the set of all columnspublic boolean isQueryComparable()
TableisQueryComparable 在类中 Tablepublic Query getTopQuery()
public String getDropSQL()
DbObjectBasegetDropSQL 在接口中 DbObjectgetDropSQL 在类中 DbObjectBasepublic String getCreateSQLForCopy(Table table, String quotedName)
DbObjectgetCreateSQLForCopy 在接口中 DbObjectgetCreateSQLForCopy 在类中 Tabletable - the new tablequotedName - the quoted namepublic String getCreateSQL()
DbObjectBasegetCreateSQL 在接口中 DbObjectgetCreateSQL 在类中 DbObjectBasepublic String getCreateSQL(boolean orReplace, boolean force)
orReplace - if true, then include the OR REPLACE clauseforce - if true, then include the FORCE clausepublic void checkRename()
DbObjectBasecheckRename 在接口中 DbObjectcheckRename 在类中 DbObjectBasepublic boolean lock(Session session, boolean exclusive, boolean forceLockEvenInMvcc)
Tablepublic boolean isLockedExclusively()
TableisLockedExclusively 在类中 Tablepublic Index addIndex(Session session, String indexName, int indexId, IndexColumn[] cols, IndexType indexType, boolean create, String indexComment)
Tablepublic void removeRow(Session session, Row row)
Tablepublic void addRow(Session session, Row row)
Tablepublic void checkSupportAlter()
TablecheckSupportAlter 在类中 Tablepublic void truncate(Session session)
Tablepublic long getRowCount(Session session)
TablegetRowCount 在类中 Tablesession - the sessionpublic boolean canGetRowCount()
TablecanGetRowCount 在类中 Tablepublic boolean canDrop()
Tablepublic TableType getTableType()
TablegetTableType 在类中 Tablepublic void removeChildrenAndResources(Session session)
DbObjectBaseremoveChildrenAndResources 在接口中 DbObjectremoveChildrenAndResources 在类中 Tablesession - the sessionpublic static void clearIndexCaches(Database database)
database - the databasepublic String getSQL()
DbObjectgetSQL 在接口中 DbObjectgetSQL 在类中 SchemaObjectBasepublic String getQuery()
public Index getScanIndex(Session session)
TablegetScanIndex 在类中 Tablesession - the sessionpublic Index getScanIndex(Session session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, HashSet<Column> allColumnsSet)
TablegetScanIndex 在类中 Tablesession - the sessionmasks - the search maskfilters - the table filtersfilter - the filter indexsortOrder - the sort orderallColumnsSet - all columnspublic boolean canReference()
TablecanReference 在类中 Tablepublic ArrayList<Index> getIndexes()
TablegetIndexes 在类中 Tablepublic long getMaxDataModificationId()
TablegetMaxDataModificationId 在类中 Tablepublic Index getUniqueIndex()
TablegetUniqueIndex 在类中 Tablepublic User getOwner()
public static TableView createTempView(Session session, User owner, String name, Query query, Query topQuery)
session - the sessionowner - the owner of the queryname - the view namequery - the querytopQuery - the top level querypublic long getRowCountApproximation()
TablegetRowCountApproximation 在类中 Tablepublic long getDiskSpaceUsed()
getDiskSpaceUsed 在类中 Tablepublic int getParameterOffset(ArrayList<Parameter> additionalParameters)
additionalParameters - additional parameterspublic boolean isRecursive()
public boolean isDeterministic()
TableisDeterministic 在类中 Tablepublic void setRecursiveResult(LocalResult value)
public LocalResult getRecursiveResult()
public void setTableExpression(boolean tableExpression)
public boolean isTableExpression()
public void addDependencies(HashSet<DbObject> dependencies)
TableaddDependencies 在类中 Tabledependencies - the current set of dependenciesCopyright © 2017. All rights reserved.