public abstract class BaseTable extends AbstractBaseTable implements Table
Table
.REGULAR_TABLE_TYPE, SYSTEM_TABLE_TYPE
Constructor and Description |
---|
BaseTable(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(Column col)
Add the given
Column to 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.TableModificationListener to the table. |
void |
addRow(Row row)
Insert the given
Row . |
abstract void |
applyDeletes(org.apache.commons.collections.primitives.IntCollection rowids)
Remove the specified rows from this table and any associated indices.
|
protected void |
applyDeletesToIndices(org.apache.commons.collections.primitives.IntCollection rowIds) |
abstract void |
applyInserts(RowCollection rows)
Insert the given rows into this table and any associated indices.
|
protected void |
applyInsertsToIndices(RowCollection rows) |
abstract void |
applyUpdates(RowCollection rows)
Update the given rows in this table and any associated indices.
|
protected void |
applyUpdatesToIndices(RowCollection rows) |
void |
checkpoint() |
protected void |
clearCache() |
void |
deleteRow(Row row)
Delete the given
Row . |
void |
drop()
Drop this table from the database.
|
abstract void |
freeRowId(int id)
Un-reserve a row id.
|
Column |
getColumn(int index)
Return the
Column corresponding to the given zero-based index . |
Column |
getColumn(java.lang.String name)
Return the
Column for the given name . |
int |
getColumnCount()
Return the number of
Column s I contain. |
java.util.List |
getColumnIdentifiers()
|
int |
getColumnIndex(java.lang.String name)
Return the zero-based index of the
Column with 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
Iterator over my indices. |
java.lang.String |
getName()
Get the name of this table.
|
abstract int |
getNextRowId()
Reserve a row id.
|
abstract Row |
getRow(int id) |
abstract int |
getRowCount()
Return the number of
Row s I contain. |
protected abstract RowIterator |
getRowIterator() |
RowIterator |
getRowIterator(boolean readOnly)
|
Sequence |
getSequence() |
java.lang.String |
getType()
Get the type of this table.
|
boolean |
hasColumn(ColumnIdentifier id)
Indicate whether the
ColumnIdentifier references 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
|
RowDecorator |
makeRowDecorator() |
TransactableTable |
makeTransactableTable()
Create a
TransactableTable for this table. |
protected void |
notifyColumnsOfNewLobDir(java.io.File directory) |
abstract void |
populateIndex(Index index)
Populate an
Index , adding my current rows to it. |
protected void |
readColumns(java.io.ObjectInputStream in) |
protected void |
readConstraints(java.io.ObjectInputStream in,
Database db) |
protected void |
recreateIndices() |
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) |
protected void |
setName(java.lang.String name) |
void |
setSequence(Sequence seq) |
protected void |
setType(java.lang.String type) |
void |
shutdown()
The database is shutting down, shutdown this table also.
|
java.lang.String |
toString() |
protected void |
truncateIndices() |
void |
updateRow(Row oldrow,
Row newrow)
Update the given
Row . |
protected void |
writeColumns(java.io.ObjectOutputStream out) |
protected void |
writeConstraints(java.io.ObjectOutputStream out) |
checkConstraints, checkConstraints, checkConstraints, getMatchingRows, hasDeferredConstraint, isDeferAll, migrate
addTableModificationListener, getTableModificationListeners, publishEvent, removeTableModificationListener, setDeferAllConstraints
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addTableModificationListener, getMatchingRows, getTableModificationListeners, migrate, removeTableModificationListener, setDeferAllConstraints, truncate
public abstract void applyDeletes(org.apache.commons.collections.primitives.IntCollection rowids) throws AxionException
Table
applyDeletes
in interface Table
AxionException
public abstract void applyInserts(RowCollection rows) throws AxionException
Table
applyInserts
in interface Table
rows
- a collection of RowsAxionException
public abstract void applyUpdates(RowCollection rows) throws AxionException
Table
applyUpdates
in interface Table
AxionException
public abstract void freeRowId(int id)
Table
public abstract int getNextRowId()
Table
getNextRowId
in interface Table
public abstract int getRowCount()
Table
Row
s I contain.getRowCount
in interface Table
public abstract void populateIndex(Index index) throws AxionException
Table
populateIndex
in interface Table
AxionException
Table.addIndex(org.axiondb.Index)
public abstract Row getRow(int id) throws AxionException
getRow
in interface RowSource
AxionException
protected abstract RowIterator getRowIterator() throws AxionException
AxionException
public RowIterator getRowIterator(boolean readOnly) throws AxionException
Table
getRowIterator
in interface Table
readOnly
- 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.AxionException
public void addRow(Row row) throws AxionException
Table
Row
.addRow
in interface Table
AxionException
public void checkpoint() throws AxionException
checkpoint
in interface Table
AxionException
public void setSequence(Sequence seq) throws AxionException
setSequence
in interface Table
AxionException
public final Sequence getSequence()
getSequence
in interface Table
public void deleteRow(Row row) throws AxionException
Table
Row
.deleteRow
in interface Table
AxionException
public void updateRow(Row oldrow, Row newrow) throws AxionException
Table
Row
.updateRow
in interface Table
AxionException
protected void truncateIndices() throws AxionException
AxionException
protected void recreateIndices() throws AxionException
AxionException
public java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String getName()
Table
public final java.lang.String getType()
Table
protected void setType(java.lang.String type)
protected void setName(java.lang.String name)
public void addConstraint(Constraint constraint) throws AxionException
addConstraint
in interface Table
AxionException
public final Constraint getConstraint(java.lang.String name)
getConstraint
in interface Table
public Constraint removeConstraint(java.lang.String name)
removeConstraint
in interface Table
public boolean isUniqueConstraintExists(java.lang.String columnName)
isUniqueConstraintExists
in interface Table
columnName
- name of the colummpublic boolean isPrimaryKeyConstraintExists(java.lang.String columnName)
isPrimaryKeyConstraintExists
in interface Table
ColumnName
- name of the columnpublic java.util.Iterator getConstraints()
getConstraints
in interface Table
public void addIndex(Index index) throws AxionException
Table
Column
, and adding it as a
org.axiondb.TableModificationListener
to the table.addIndex
in interface Table
AxionException
Table.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
Table
removeIndex
in interface Table
AxionException
public Index getIndexForColumn(Column column)
Table
getIndexForColumn
in interface Table
Column
, or null
if no such
Index
existspublic boolean isColumnIndexed(Column column)
Table
isColumnIndexed
in interface Table
column
- Column
to checkIndex
for the given Column
public RowIterator getIndexedRows(Selectable node, boolean readOnly) throws AxionException
getIndexedRows
in interface Table
readOnly
- 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.AxionException
public RowIterator getIndexedRows(RowSource source, Selectable node, boolean readOnly) throws AxionException
getIndexedRows
in interface Table
AxionException
public void addColumn(Column col) throws AxionException
Column
to this table. This implementation throws an
AxionException
if rows have already been added to the table.addColumn
in interface Table
AxionException
protected final void clearCache()
public boolean hasColumn(ColumnIdentifier id)
Table
ColumnIdentifier
references a column in this tablepublic final Column getColumn(int index)
Table
Column
corresponding to the given zero-based index .public Column getColumn(java.lang.String name)
Table
Column
for the given name .public int getColumnIndex(java.lang.String name) throws AxionException
Table
Column
with the given name .getColumnIndex
in interface RowSource
getColumnIndex
in interface Table
AxionException
public java.util.List getColumnIdentifiers()
Table
getColumnIdentifiers
in interface Table
public final int getColumnCount()
Table
Column
s I contain.getColumnCount
in interface RowSource
getColumnCount
in interface Table
public void drop() throws AxionException
Table
drop
in interface Table
AxionException
public void remount(java.io.File dir, boolean datafilesonly) throws AxionException
Table
remount
in interface Table
AxionException
public void rename(java.lang.String oldName, java.lang.String newName) throws AxionException
rename
in interface Table
AxionException
public void shutdown() throws AxionException
Table
shutdown
in interface Table
AxionException
public RowDecorator makeRowDecorator()
makeRowDecorator
in interface RowSource
makeRowDecorator
in interface Table
public TransactableTable makeTransactableTable()
Table
TransactableTable
for this table.makeTransactableTable
in interface Table
public java.util.Iterator getIndices()
Table
Iterator
over my indices.getIndices
in interface Table
protected void notifyColumnsOfNewLobDir(java.io.File directory) throws AxionException
AxionException
protected void writeColumns(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
protected void readColumns(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
protected void writeConstraints(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
protected void readConstraints(java.io.ObjectInputStream in, Database db) throws java.io.IOException, java.lang.ClassNotFoundException, AxionException
java.io.IOException
java.lang.ClassNotFoundException
AxionException
protected void applyDeletesToIndices(org.apache.commons.collections.primitives.IntCollection rowIds) throws AxionException
AxionException
protected void applyUpdatesToIndices(RowCollection rows) throws AxionException
AxionException
protected void applyInsertsToIndices(RowCollection rows) throws AxionException
AxionException