public final class TransactableTableImpl extends AbstractBaseTable implements TransactableTable
TransactableTable.REGULAR_TABLE_TYPE, SYSTEM_TABLE_TYPE| Constructor and Description |
|---|
TransactableTableImpl(Table table) |
| 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 |
apply()
Apply this
committedtransaction.. |
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 |
commit()
This transaction has been committed.
|
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() |
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. |
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() |
Table |
getTable() |
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)
|
protected boolean |
isDeferAll() |
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
|
RowDecorator |
makeRowDecorator() |
TransactableTable |
makeTransactableTable()
Create a
TransactableTablefor this table. |
void |
populateIndex(Index index)
Populate an
Index, adding my current rows to it. |
void |
remount(java.io.File dir,
boolean dataOnly)
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 |
rollback()
This transaction has been aborted.
|
void |
setDeferAllConstraints(boolean deferAll) |
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. |
checkConstraints, checkConstraints, checkConstraints, getMatchingRows, hasDeferredConstraint, migrateaddTableModificationListener, getTableModificationListeners, publishEvent, removeTableModificationListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddTableModificationListener, getMatchingRows, getTableModificationListeners, migrate, removeTableModificationListenerpublic TransactableTableImpl(Table table)
public final java.lang.String getName()
Tablepublic final Table getTable()
public final java.lang.String getType()
Tablepublic final RowDecorator makeRowDecorator()
makeRowDecorator in interface RowSourcemakeRowDecorator in interface Tablepublic void addConstraint(Constraint constraint) throws AxionException
addConstraint in interface TableAxionExceptionpublic Constraint removeConstraint(java.lang.String name)
removeConstraint in interface Tablepublic final Constraint getConstraint(java.lang.String name)
getConstraint in interface Tablepublic final java.util.Iterator getConstraints()
getConstraints in interface Tablepublic boolean isUniqueConstraintExists(java.lang.String columnName)
isUniqueConstraintExists in interface TablecolumnName - name of the colummpublic boolean isPrimaryKeyConstraintExists(java.lang.String columnName)
isPrimaryKeyConstraintExists in interface TableColumnName - name of the columnpublic 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 removeIndex(Index index) throws AxionException
TableremoveIndex in interface TableAxionExceptionpublic final boolean hasIndex(java.lang.String name)
throws AxionException
hasIndex in interface TableAxionExceptionpublic final void populateIndex(Index index) throws AxionException
TablepopulateIndex in interface TableAxionExceptionTable.addIndex(org.axiondb.Index)public final Index getIndexForColumn(Column column)
TablegetIndexForColumn in interface TableColumn, or null if no such
Indexexistspublic final boolean isColumnIndexed(Column column)
TableisColumnIndexed in interface Tablecolumn - Columnto checkIndexfor the given Columnpublic void addColumn(Column col) throws AxionException
TableColumnto this table.addColumn in interface TableAxionExceptionpublic final Column getColumn(int index)
TableColumncorresponding to the given zero-based index .public final Column getColumn(java.lang.String name)
TableColumnfor the given name .public final boolean hasColumn(ColumnIdentifier id)
TableColumnIdentifierreferences a column in this tablepublic final int getColumnIndex(java.lang.String name)
throws AxionException
TableColumnwith the given name .getColumnIndex in interface RowSourcegetColumnIndex in interface TableAxionExceptionpublic final java.util.List getColumnIdentifiers()
TablegetColumnIdentifiers in interface Tablepublic final int getColumnCount()
TableColumns I contain.getColumnCount in interface RowSourcegetColumnCount in interface Tablepublic final java.util.Iterator getIndices()
TableIteratorover my indices.getIndices in interface Tablepublic void addRow(Row row) throws AxionException
TableRow.addRow in interface TableAxionExceptionpublic 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 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 RowIterator getIndexedRows(RowSource source, Selectable node, boolean readOnly) throws AxionException
getIndexedRows in interface TableAxionExceptionpublic final int getRowCount()
TableRows I contain.getRowCount in interface Tablepublic final int getNextRowId()
TablegetNextRowId in interface Tablepublic final void freeRowId(int id)
Tablepublic void drop()
throws AxionException
Tabledrop in interface TableAxionExceptionpublic void checkpoint()
throws AxionException
checkpoint in interface TableAxionExceptionpublic void shutdown()
throws AxionException
Tableshutdown in interface TableAxionExceptionpublic void setDeferAllConstraints(boolean deferAll)
setDeferAllConstraints in interface TablesetDeferAllConstraints in class BaseTableModificationPublisherpublic void setSequence(Sequence seq) throws AxionException
setSequence in interface TableAxionExceptionpublic final Sequence getSequence()
getSequence in interface Tablepublic void remount(java.io.File dir,
boolean dataOnly)
throws AxionException
Tableremount in interface TableAxionExceptionpublic void rename(java.lang.String oldName,
java.lang.String newName)
throws AxionException
rename in interface TableAxionExceptionpublic Row getRow(int id) throws AxionException
getRow in interface RowSourceAxionExceptionpublic final void applyInserts(RowCollection rows) throws AxionException
TableapplyInserts in interface Tablerows - a collection of RowsAxionExceptionpublic final void applyDeletes(org.apache.commons.collections.primitives.IntCollection rowids)
throws AxionException
TableapplyDeletes in interface TableAxionExceptionpublic final void applyUpdates(RowCollection rows) throws AxionException
TableapplyUpdates in interface TableAxionExceptionpublic void commit()
throws AxionException
Transactablecommit in interface TransactableAxionExceptionpublic void rollback()
throws AxionException
Transactablerollback in interface TransactableAxionExceptionpublic void apply()
throws AxionException
Transactablecommittedtransaction..apply in interface TransactableAxionExceptionpublic final TransactableTable makeTransactableTable()
TableTransactableTablefor this table.makeTransactableTable in interface Tablepublic void deleteRow(Row row) throws AxionException
TableRow.deleteRow in interface TableAxionExceptionpublic void updateRow(Row oldrow, Row newrow) throws AxionException
TableRow.updateRow in interface TableAxionExceptionprotected final boolean isDeferAll()
isDeferAll in class AbstractBaseTablepublic void truncate()
throws AxionException
Tabletruncate in interface TableAxionExceptionpublic java.lang.String toString()
toString in class java.lang.Object