public class TableLink extends Table
columns, compareMode, EXTERNAL_TABLE_ENGINE, isHidden, SYSTEM_TABLE, TABLE, TABLE_LINK, TYPE_CACHED, TYPE_MEMORY, VIEWcomment, database, traceAGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE| Constructor and Description |
|---|
TableLink(Schema schema,
int id,
String name,
String driver,
String url,
String user,
String password,
String originalSchema,
String originalTable,
boolean emitUpdates,
boolean force) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
checkRename()
Check if this object can be renamed.
|
void |
checkSupportAlter()
Check if this table supports ALTER TABLE.
|
void |
checkWritingAllowed()
Linked tables don't know if they are readonly.
|
void |
close(Session session)
Close the table object and flush changes.
|
PreparedStatement |
execute(String sql,
ArrayList<Value> params,
boolean reusePrepared)
Execute a SQL statement using the given parameters.
|
String |
getCreateSQL()
Build a SQL statement to re-create this object.
|
Value |
getDefaultValue(Session session,
Column column)
Get or generate a default value for the given column.
|
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.
|
String |
getQualifiedTable() |
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.
|
String |
getTableType()
Get the table type name
|
Index |
getUniqueIndex()
Get any unique index for this table if one exists.
|
boolean |
isDeterministic()
Check if the table is deterministic.
|
boolean |
isLockedExclusively()
Check if this table is locked exclusively.
|
boolean |
isOracle() |
void |
lock(Session session,
boolean exclusive,
boolean force)
Lock the table for the given session.
|
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 |
reusePreparedStatement(PreparedStatement prep,
String sql)
Add this prepared statement to the list of cached statements.
|
void |
setGlobalTemporary(boolean globalTemporary) |
void |
setReadOnly(boolean readOnly) |
void |
truncate(Session session)
Remove all rows from the table and indexes.
|
void |
unlock(Session s)
Release the lock for this session.
|
void |
updateRows(Prepared prepared,
Session session,
RowList rows)
Update a list of rows in this table.
|
void |
validateConvertUpdateSequence(Session session,
Row row)
Convert the values if required.
|
static DbException |
wrapException(String sql,
Exception ex)
Wrap a SQL exception that occurred while accessing a linked table.
|
addConstraint, addDependencies, addSequence, addTrigger, addView, canReference, canTruncate, checkDeadlock, commit, compareTypeSave, doesColumnExist, dropSingleColumnConstraintsAndIndexes, findPrimaryKey, fire, fireAfterRow, fireBeforeRow, fireRow, getBestPlanItem, getCheckForeignKeyConstraints, getChildren, getColumn, getColumn, getColumns, getCompareMode, getConstraints, getCreateSQLForCopy, getIndexForColumn, getOnCommitDrop, getOnCommitTruncate, getPrimaryKey, getRowIdColumn, getTemplateRow, getTemplateSimpleRow, getType, getViews, hasSelectTrigger, isGlobalTemporary, isHidden, isLockedExclusivelyBy, isPersistData, isPersistIndexes, removeConstraint, removeIndex, removeIndexOrTransferOwnership, removeSequence, removeTrigger, removeView, rename, renameColumn, setCheckForeignKeyConstraints, setColumns, setHidden, setOnCommitDrop, setOnCommitTruncategetSchema, getSQL, initSchemaObjectBasegetComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComment, getDatabase, getId, getName, isTemporary, setComment, setTemporarypublic String getDropSQL()
DbObjectBasegetDropSQL in interface DbObjectgetDropSQL in class DbObjectBasepublic String getCreateSQL()
DbObjectBasegetCreateSQL in interface DbObjectgetCreateSQL in class DbObjectBasepublic Index addIndex(Session session, String indexName, int indexId, IndexColumn[] cols, IndexType indexType, boolean create, String indexComment)
Tablepublic void lock(Session session, boolean exclusive, boolean force)
Tablepublic boolean isLockedExclusively()
TableisLockedExclusively in class Tablepublic Index getScanIndex(Session session)
TablegetScanIndex in class Tablesession - the sessionpublic void removeRow(Session session, Row row)
Tablepublic void addRow(Session session, Row row)
Tablepublic void close(Session session)
Tablepublic long getRowCount(Session session)
TablegetRowCount in class Tablesession - the sessionpublic static DbException wrapException(String sql, Exception ex)
sql - the SQL statementex - the exception from the remote databasepublic String getQualifiedTable()
public PreparedStatement execute(String sql, ArrayList<Value> params, boolean reusePrepared)
sql - the SQL statementparams - the parameters or nullreusePrepared - if the prepared statement can be re-used immediatelypublic void unlock(Session s)
Tablepublic void checkRename()
DbObjectBasecheckRename in interface DbObjectcheckRename in class DbObjectBasepublic void checkSupportAlter()
TablecheckSupportAlter in class Tablepublic void truncate(Session session)
Tablepublic boolean canGetRowCount()
TablecanGetRowCount in class Tablepublic boolean canDrop()
Tablepublic String getTableType()
TablegetTableType in class Tablepublic void removeChildrenAndResources(Session session)
DbObjectBaseremoveChildrenAndResources in interface DbObjectremoveChildrenAndResources in class Tablesession - the sessionpublic boolean isOracle()
public ArrayList<Index> getIndexes()
TablegetIndexes in class Tablepublic long getMaxDataModificationId()
TablegetMaxDataModificationId in class Tablepublic Index getUniqueIndex()
TablegetUniqueIndex in class Tablepublic void updateRows(Prepared prepared, Session session, RowList rows)
TableupdateRows in class Tableprepared - the prepared statementsession - the sessionrows - a list of row pairs of the form old row, new row, old row,
new row,...public void setGlobalTemporary(boolean globalTemporary)
public void setReadOnly(boolean readOnly)
public long getRowCountApproximation()
TablegetRowCountApproximation in class Tablepublic void reusePreparedStatement(PreparedStatement prep, String sql)
prep - the prepared statementsql - the SQL statementpublic boolean isDeterministic()
TableisDeterministic in class Tablepublic void checkWritingAllowed()
checkWritingAllowed in class Tablepublic void validateConvertUpdateSequence(Session session, Row row)
validateConvertUpdateSequence in class Tablesession - the sessionrow - the rowpublic Value getDefaultValue(Session session, Column column)
getDefaultValue in class Tablesession - the sessioncolumn - the columnCopyright © 2012 JBoss by Red Hat. All Rights Reserved.