columns, compareMode, EXCLUSIVE_LOCK, isHidden, READ_LOCK, TYPE_CACHED, TYPE_MEMORY, WRITE_LOCK
AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USER
ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS
Constructor and Description |
---|
TableLink(Schema schema,
int id,
java.lang.String name,
java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String originalSchema,
java.lang.String originalTable,
boolean emitUpdates,
boolean force) |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
checkSupportAlter()
Check if this table supports ALTER TABLE.
|
void |
checkWritingAllowed()
Linked tables don't know if they are readonly.
|
void |
close(SessionLocal session)
Close the table object and flush changes.
|
void |
convertInsertRow(SessionLocal session,
Row row,
java.lang.Boolean overridingSystem)
Prepares the specified row for INSERT operation.
|
void |
convertUpdateRow(SessionLocal session,
Row row,
boolean fromTrigger)
Prepares the specified row for UPDATE operation.
|
java.sql.PreparedStatement |
execute(java.lang.String sql,
java.util.ArrayList<Value> params,
boolean reusePrepared,
SessionLocal session)
Execute a SQL statement using the given parameters.
|
boolean |
getAutocommit()
The autocommit mode
|
java.lang.String |
getCreateSQL()
Construct the CREATE ...
|
java.lang.String |
getDropSQL()
Construct a DROP ...
|
int |
getFetchSize()
The number of rows to fetch
default is 0
|
java.lang.String |
getIdentifierQuoteString()
Returns the identifier quote string or space.
|
java.util.ArrayList<Index> |
getIndexes()
Get all indexes for this table.
|
long |
getMaxDataModificationId()
Get the last data modification id.
|
java.lang.String |
getQualifiedTable() |
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
|
boolean |
isDeterministic()
Check if the table is deterministic.
|
boolean |
isInsertable()
Returns whether this table is insertable.
|
boolean |
isOracle() |
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.
|
void |
reusePreparedStatement(java.sql.PreparedStatement prep,
java.lang.String sql)
Add this prepared statement to the list of cached statements.
|
void |
setAutoCommit(boolean mode)
Specify if the autocommit mode is activated or not
|
void |
setFetchSize(int fetchSize)
Specify the number of rows fetched by the linked table command
|
void |
setGlobalTemporary(boolean globalTemporary) |
void |
setReadOnly(boolean readOnly) |
long |
truncate(SessionLocal session)
Remove all rows from the table and indexes.
|
void |
updateRows(Prepared prepared,
SessionLocal session,
LocalResult rows)
Update a list of rows in this table.
|
static DbException |
wrapException(java.lang.String sql,
java.lang.Exception ex)
Wrap a SQL exception that occurred while accessing a linked table.
|
addConstraint, addDependencies, addDependentMaterializedView, addDependentView, addSequence, addSynonym, addTrigger, canReference, canTruncate, checkDeadlock, compareValues, 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, 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
getSchema, getSQL, getSQL
checkRename, getComment, getCreateSQLForCopy, getCreateSQLForMeta, getDatabase, getId, getModificationId, getName, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTraceSQL
public TableLink(Schema schema, int id, java.lang.String name, java.lang.String driver, java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String originalSchema, java.lang.String originalTable, boolean emitUpdates, boolean force)
public java.lang.String getDropSQL()
DbObject
getDropSQL
in class DbObject
public java.lang.String getCreateSQL()
DbObject
getCreateSQL
in class DbObject
public Index addIndex(SessionLocal session, java.lang.String indexName, int indexId, IndexColumn[] cols, int uniqueColumnCount, IndexType indexType, boolean create, java.lang.String indexComment)
Table
addIndex
in class Table
session
- 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 commentpublic Index getScanIndex(SessionLocal session)
Table
getScanIndex
in class Table
session
- the sessionpublic boolean isInsertable()
Table
isInsertable
in class Table
public void removeRow(SessionLocal session, Row row)
Table
public void addRow(SessionLocal session, Row row)
Table
public void close(SessionLocal session)
Table
public long getRowCount(SessionLocal session)
Table
getRowCount
in class Table
session
- the sessionpublic static DbException wrapException(java.lang.String sql, java.lang.Exception ex)
sql
- the SQL statementex
- the exception from the remote databasepublic java.lang.String getQualifiedTable()
public java.sql.PreparedStatement execute(java.lang.String sql, java.util.ArrayList<Value> params, boolean reusePrepared, SessionLocal session)
sql
- the SQL statementparams
- the parameters or nullreusePrepared
- if the prepared statement can be re-used immediatelysession
- the sessionpublic void checkSupportAlter()
Table
checkSupportAlter
in class Table
public long truncate(SessionLocal session)
Table
public boolean canGetRowCount(SessionLocal session)
Table
canGetRowCount
in class Table
session
- the sessionpublic boolean canDrop()
Table
public TableType getTableType()
Table
getTableType
in class Table
public void removeChildrenAndResources(SessionLocal session)
DbObject
removeChildrenAndResources
in class Table
session
- the sessionpublic boolean isOracle()
public java.util.ArrayList<Index> getIndexes()
Table
getIndexes
in class Table
public long getMaxDataModificationId()
Table
getMaxDataModificationId
in class Table
public void updateRows(Prepared prepared, SessionLocal session, LocalResult rows)
Table
updateRows
in class Table
prepared
- 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(SessionLocal session)
Table
getRowCountApproximation
in class Table
session
- the sessionpublic void reusePreparedStatement(java.sql.PreparedStatement prep, java.lang.String sql)
prep
- the prepared statementsql
- the SQL statementpublic boolean isDeterministic()
Table
isDeterministic
in class Table
public void checkWritingAllowed()
checkWritingAllowed
in class Table
public void convertInsertRow(SessionLocal session, Row row, java.lang.Boolean overridingSystem)
Table
convertInsertRow
in class Table
session
- the sessionrow
- the rowoverridingSystem
- Boolean.TRUE
for OVERRIDING SYSTEM VALUES
,
Boolean.FALSE
for OVERRIDING USER VALUES
,
null
if override clause is not specifiedpublic void convertUpdateRow(SessionLocal session, Row row, boolean fromTrigger)
Table
convertUpdateRow
in class Table
session
- the sessionrow
- the rowfromTrigger
- true
if row was modified by INSERT or UPDATE triggerpublic void setFetchSize(int fetchSize)
fetchSize
- to setpublic void setAutoCommit(boolean mode)
mode
- to setpublic boolean getAutocommit()
public int getFetchSize()
public java.lang.String getIdentifierQuoteString()