public class ExternalAxionDBTable extends BaseTableModificationPublisher implements ExternalTable
DatabaseLink,
ExternalDatabaseTableCOLUMNS_ARE_CASE_SENSITIVE, DELIMITED_TABLE_TYPE, EXTERNAL_DB_TABLE_TYPE, FW_TABLE_TYPE, PROP_CATALOG, PROP_CREATE_IF_NOT_EXIST, PROP_DB, PROP_LOADTYPE, PROP_ORDERBY, PROP_REMOTETABLE, PROP_SCHEMA, PROP_VENDOR, PROP_WHERE, TAGGED_EBCDIC_TABLE_TYPEREGULAR_TABLE_TYPE, SYSTEM_TABLE_TYPE| Constructor and Description |
|---|
ExternalAxionDBTable(java.lang.String name,
Database db) |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(Column col)
Add the given
Columnto this table. |
void |
addConstraint(Constraint constraint) |
void |
addIndex(Index index)
Add an index, associating it with a
Column, and adding it as a
org.axiondb.TableModificationListenerto the table. |
void |
addRow(Row row)
Insert the given
Row. |
void |
applyDeletes(org.apache.commons.collections.primitives.IntCollection rowIds)
Remove the specified rows from this table and any associated indices.
|
void |
applyInserts(RowCollection rows)
Insert the given rows into this table and any associated indices.
|
void |
applyUpdates(RowCollection rows)
Update the given rows in this table and any associated indices.
|
void |
checkpoint() |
void |
deleteRow(Row row)
Delete the given
Row. |
void |
drop()
Drop this table from the database.
|
void |
freeRowId(int id)
Un-reserve a row id.
|
Column |
getColumn(int index)
Return the
Columncorresponding to the given zero-based index . |
Column |
getColumn(java.lang.String name)
Return the
Columnfor the given name . |
int |
getColumnCount()
Return the number of
Columns I contain. |
java.util.List |
getColumnIdentifiers()
|
int |
getColumnIndex(java.lang.String name)
Return the zero-based index of the
Columnwith the given name . |
Constraint |
getConstraint(java.lang.String name) |
java.util.Iterator |
getConstraints() |
java.lang.String |
getDBLinkName() |
RowIterator |
getIndexedRows(RowSource source,
Selectable node,
boolean readOnly) |
RowIterator |
getIndexedRows(Selectable node,
boolean readOnly) |
Index |
getIndexForColumn(Column column)
|
java.util.Iterator |
getIndices()
Obtain an
Iteratorover my indices. |
RowIterator |
getMatchingRows(java.util.List selectables,
java.util.List values,
boolean readOnly)
Obtain an
iteratorover my Rows where each
Selectablein the selectable list
evaluatesto the corresponding value in the value
list. |
java.lang.String |
getName()
Get the name of this table.
|
int |
getNextRowId()
Reserve a row id.
|
Row |
getRow(int id) |
int |
getRowCount()
Return the number of
Rows I contain. |
RowIterator |
getRowIterator(boolean readOnly)
|
Sequence |
getSequence() |
java.util.Properties |
getTableProperties()
Gets Organization Property.
|
java.lang.String |
getType()
Get the type of this table.
|
boolean |
hasColumn(ColumnIdentifier id)
Indicate whether the
ColumnIdentifierreferences a column in this table |
boolean |
hasIndex(java.lang.String name) |
boolean |
isColumnIndexed(Column column)
|
boolean |
isPrimaryKeyConstraintExists(java.lang.String columnName)
check if primary constraint exists on a column
|
boolean |
isUniqueConstraintExists(java.lang.String columnName)
check if unique constraint exists on a column
|
boolean |
loadExternalTable(java.util.Properties props)
Loads external data using the given properties table - should be called only once by
the table factory.
|
RowDecorator |
makeRowDecorator() |
TransactableTable |
makeTransactableTable()
Create a
TransactableTablefor this table. |
void |
migrate()
Migrate from older version to newer version for this table
|
void |
populateIndex(Index index)
Populate an
Index, adding my current rows to it. |
void |
remount() |
void |
remount(java.io.File dir,
boolean datafilesonly)
Notify this table that its disk-location has moved.
|
Constraint |
removeConstraint(java.lang.String name) |
void |
removeIndex(Index index)
Remove an index, both from the indices and as a TableModificationListener
|
void |
rename(java.lang.String oldName,
java.lang.String newName) |
void |
setSequence(Sequence seq) |
void |
shutdown()
The database is shutting down, shutdown this table also.
|
java.lang.String |
toString() |
void |
truncate()
Unconditionally delete all rows in this table.
|
void |
updateRow(Row oldrow,
Row newrow)
Update the given
Row. |
addTableModificationListener, getTableModificationListeners, publishEvent, removeTableModificationListener, setDeferAllConstraintsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddTableModificationListener, getTableModificationListeners, removeTableModificationListener, setDeferAllConstraintspublic ExternalAxionDBTable(java.lang.String name,
Database db)
public void addColumn(Column col) throws AxionException
TableColumnto this table.addColumn in interface TableAxionExceptionpublic void addConstraint(Constraint constraint) throws AxionException
addConstraint in interface TableAxionExceptionpublic void addIndex(Index index) throws AxionException
TableColumn, and adding it as a
org.axiondb.TableModificationListenerto the table.addIndex in interface TableAxionExceptionTable.addIndex(org.axiondb.Index),
Table.addTableModificationListener(org.axiondb.event.TableModificationListener),
Table.getIndexForColumn(org.axiondb.Column),
Table.isColumnIndexed(org.axiondb.Column),
Table.populateIndex(org.axiondb.Index)public void addRow(Row row) throws AxionException
TableRow.addRow in interface TableAxionExceptionpublic void applyDeletes(org.apache.commons.collections.primitives.IntCollection rowIds)
throws AxionException
TableapplyDeletes in interface TableAxionExceptionpublic void applyInserts(RowCollection rows) throws AxionException
TableapplyInserts in interface Tablerows - a collection of RowsAxionExceptionpublic void applyUpdates(RowCollection rows) throws AxionException
TableapplyUpdates in interface TableAxionExceptionpublic void checkpoint()
throws AxionException
checkpoint in interface TableAxionExceptionpublic void deleteRow(Row row) throws AxionException
TableRow.deleteRow in interface TableAxionExceptionpublic void drop()
throws AxionException
Tabledrop in interface TableAxionExceptionpublic void freeRowId(int id)
Tablepublic Column getColumn(int index)
TableColumncorresponding to the given zero-based index .public Column getColumn(java.lang.String name)
TableColumnfor the given name .public int getColumnCount()
TableColumns I contain.getColumnCount in interface RowSourcegetColumnCount in interface Tablepublic java.util.List getColumnIdentifiers()
TablegetColumnIdentifiers in interface Tablepublic int getColumnIndex(java.lang.String name)
throws AxionException
TableColumnwith the given name .getColumnIndex in interface RowSourcegetColumnIndex in interface TableAxionExceptionpublic java.util.Iterator getConstraints()
getConstraints in interface Tablepublic java.lang.String getDBLinkName()
public RowIterator getIndexedRows(RowSource source, Selectable node, boolean readOnly) throws AxionException
getIndexedRows in interface TableAxionExceptionpublic RowIterator getIndexedRows(Selectable node, boolean readOnly) throws AxionException
getIndexedRows in interface TablereadOnly - when true, the caller does not expect to be able to
modify (i.e., call RowIterator.set(org.axiondb.Row)or RowIterator.remove()on)
the returned RowIterator, the returned iterator may be
unmodifiable.AxionExceptionpublic Index getIndexForColumn(Column column)
TablegetIndexForColumn in interface TableColumn, or null if no such
Indexexistspublic java.util.Iterator getIndices()
TableIteratorover my indices.getIndices in interface Tablepublic RowIterator getMatchingRows(java.util.List selectables, java.util.List values, boolean readOnly) throws AxionException
Tableiteratorover my Rows where each
Selectablein the selectable list
evaluatesto the corresponding value in the value
list.
This is functionally similiar to executing a SELECT over this table where selectable[i] = value[i] for each value of i . The return RowIterator is not modifiable.
getMatchingRows in interface TableAxionExceptionpublic java.lang.String getName()
Tablepublic int getNextRowId()
TablegetNextRowId in interface Tablepublic Row getRow(int id) throws AxionException
getRow in interface RowSourceAxionExceptionpublic int getRowCount()
TableRows I contain.getRowCount in interface Tablepublic RowIterator getRowIterator(boolean readOnly) throws AxionException
TablegetRowIterator in interface TablereadOnly - when true, the caller does not expect to be able to
modify (i.e., call RowIterator.set(org.axiondb.Row)or RowIterator.remove()on)
the returned RowIterator, the returned iterator may be
unmodifiable.AxionExceptionpublic Sequence getSequence()
getSequence in interface Tablepublic java.util.Properties getTableProperties()
ExternalTablegetTableProperties in interface ExternalTablepublic java.lang.String getType()
Tablepublic boolean hasColumn(ColumnIdentifier id)
TableColumnIdentifierreferences a column in this tablepublic boolean hasIndex(java.lang.String name)
throws AxionException
hasIndex in interface TableAxionExceptionpublic boolean isColumnIndexed(Column column)
TableisColumnIndexed in interface Tablecolumn - Columnto checkIndexfor the given Columnpublic boolean isPrimaryKeyConstraintExists(java.lang.String columnName)
TableisPrimaryKeyConstraintExists in interface Tablepublic boolean isUniqueConstraintExists(java.lang.String columnName)
TableisUniqueConstraintExists in interface TablecolumnName - name of the colummpublic boolean loadExternalTable(java.util.Properties props)
throws AxionException
ExternalTableloadExternalTable in interface ExternalTableprops - configuration properties for this external tableAxionExceptionpublic RowDecorator makeRowDecorator()
makeRowDecorator in interface RowSourcemakeRowDecorator in interface Tablepublic TransactableTable makeTransactableTable()
TableTransactableTablefor this table.makeTransactableTable in interface Tablepublic void migrate()
throws AxionException
Tablemigrate in interface TableAxionExceptionpublic void populateIndex(Index index) throws AxionException
TablepopulateIndex in interface TableAxionExceptionTable.addIndex(org.axiondb.Index)public void remount()
throws AxionException
remount in interface ExternalTableAxionExceptionpublic void remount(java.io.File dir,
boolean datafilesonly)
throws AxionException
Tableremount in interface TableAxionExceptionpublic Constraint removeConstraint(java.lang.String name)
removeConstraint in interface Tablepublic Constraint getConstraint(java.lang.String name)
getConstraint in interface Tablepublic void removeIndex(Index index) throws AxionException
TableremoveIndex in interface TableAxionExceptionpublic void rename(java.lang.String oldName,
java.lang.String newName)
throws AxionException
rename in interface TableAxionExceptionpublic void setSequence(Sequence seq) throws AxionException
setSequence in interface TableAxionExceptionpublic void shutdown()
throws AxionException
Tableshutdown in interface TableAxionExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void truncate()
throws AxionException
Tabletruncate in interface TableAxionExceptionpublic void updateRow(Row oldrow, Row newrow) throws AxionException
TableRow.updateRow in interface TableAxionException