org.axiondb.engine.tables

Class ExternalDatabaseTable

public class ExternalDatabaseTable extends Object implements ExternalTable, TransactableTable

Base implementation of ExternalTable interface.

Example: create external table emp (lname varchar(80), sid integer(6), fname varchar(80), id integer(6) not null, dob timestamp(6)) organization (loadtype='remote' SERVER='myserver' REMOTETABLE='mytablename' SCHEMA='myschema' WHERE='id > 1000');

Note : We have tested this for Oracle 8i/9i/10g , SQL Server, Sybase and DB2.

Version: $Revision: 1.27 $ $Date: 2006/01/10 21:02:36 $

Author: Jonathan Giron Rahul Dwivedi Ahimanikya Satapathy

See Also: DatabaseLink

Constructor Summary
ExternalDatabaseTable(String name, Database db)
Method Summary
voidaddColumn(Column col)
Add the given Columnto this table.
voidaddConstraint(Constraint constraint)
voidaddConstraint(Constraint constraint, boolean checkExistingRows)
voidaddIndex(Index index)
voidaddRow(Row row)
voidaddTableModificationListener(TableModificationListener listener)
voidapply()
voidapplyDeletes(IntCollection rowIds)
voidapplyInserts(RowCollection rows)
voidapplyUpdates(RowCollection rows)
protected voidcheckConstraints(RowEvent event)
voidcheckpoint()
voidcommit()
voiddeleteRow(Row row)
voiddrop()
voidfreeRowId(int id)
ColumngetColumn(int index)
ColumngetColumn(String name)
intgetColumnCount()
ListgetColumnIdentifiers()
intgetColumnIndex(String name)
ConstraintgetConstraint(String name)
IteratorgetConstraints()
StringgetDBLinkName()
protected StringgetDeleteSQL()
RowIteratorgetIndexedRows(RowSource source, Selectable node, boolean readOnly)
RowIteratorgetIndexedRows(Selectable node, boolean readOnly)
IndexgetIndexForColumn(Column column)
IteratorgetIndices()
protected StringgetInsertSQL()
RowIteratorgetMatchingRows(List selectables, List values, boolean readOnly)
StringgetName()
intgetNextRowId()
RowgetRow(int id)
intgetRowCount()
RowIteratorgetRowIterator(boolean readOnly)
protected RowIteratorgetRowIterator()
protected StringgetSchemaWildcardForRemoteDB()
Gets appropriate string for use in indicating wildcard search for schemas.
protected StringgetSelectSQL(String where)
SequencegetSequence()
IteratorgetTableModificationListeners()
PropertiesgetTableProperties()
StringgetType()
protected StringgetUpdateSQL()
booleanhasColumn(ColumnIdentifier id)
booleanhasIndex(String name)
booleanisColumnIndexed(Column column)
booleanisPrimaryKeyConstraintExists(String columnName)
booleanisUniqueConstraintExists(String columnName)
check if unique constraint exists on a column
booleanloadExternalTable(Properties props)
RowDecoratormakeRowDecorator()
TransactableTablemakeTransactableTable()
voidmigrate()
voidpopulateIndex(Index index)
voidremount()
voidremount(File dir, boolean datafilesonly)
ConstraintremoveConstraint(String name)
voidremoveIndex(Index index)
voidremoveTableModificationListener(TableModificationListener listener)
voidrename(String oldName, String newName)
voidrollback()
voidsetDeferAllConstraints(boolean deferAll)
voidsetSequence(Sequence seq)
protected voidsetUp(DatabaseLink server)
voidshutdown()
StringtoString()
voidtruncate()
voidupdateRow(Row oldrow, Row newrow)
voidupdateRow(Row oldrow, Row newrow, List cols)

Constructor Detail

ExternalDatabaseTable

public ExternalDatabaseTable(String name, Database db)

Method Detail

addColumn

public void addColumn(Column col)
Add the given Columnto this table. This implementation throws an AxionExceptionif rows have already been added to the table.

addConstraint

public void addConstraint(Constraint constraint)

addConstraint

public void addConstraint(Constraint constraint, boolean checkExistingRows)

addIndex

public void addIndex(Index index)

addRow

public void addRow(Row row)

addTableModificationListener

public void addTableModificationListener(TableModificationListener listener)

apply

public void apply()

applyDeletes

public void applyDeletes(IntCollection rowIds)

applyInserts

public void applyInserts(RowCollection rows)

applyUpdates

public void applyUpdates(RowCollection rows)

checkConstraints

protected void checkConstraints(RowEvent event)

checkpoint

public void checkpoint()

commit

public void commit()

deleteRow

public void deleteRow(Row row)

drop

public void drop()

freeRowId

public void freeRowId(int id)

getColumn

public final Column getColumn(int index)

getColumn

public Column getColumn(String name)

getColumnCount

public final int getColumnCount()

getColumnIdentifiers

public List getColumnIdentifiers()

getColumnIndex

public int getColumnIndex(String name)

getConstraint

public final Constraint getConstraint(String name)

getConstraints

public Iterator getConstraints()

getDBLinkName

public String getDBLinkName()

getDeleteSQL

protected String getDeleteSQL()

getIndexedRows

public RowIterator getIndexedRows(RowSource source, Selectable node, boolean readOnly)

getIndexedRows

public RowIterator getIndexedRows(Selectable node, boolean readOnly)

getIndexForColumn

public Index getIndexForColumn(Column column)

getIndices

public Iterator getIndices()

getInsertSQL

protected String getInsertSQL()

getMatchingRows

public RowIterator getMatchingRows(List selectables, List values, boolean readOnly)

getName

public final String getName()

getNextRowId

public int getNextRowId()

getRow

public Row getRow(int id)

getRowCount

public int getRowCount()

getRowIterator

public RowIterator getRowIterator(boolean readOnly)

getRowIterator

protected RowIterator getRowIterator()

getSchemaWildcardForRemoteDB

protected String getSchemaWildcardForRemoteDB()
Gets appropriate string for use in indicating wildcard search for schemas.

Returns: wildcard string.

getSelectSQL

protected String getSelectSQL(String where)

getSequence

public final Sequence getSequence()

getTableModificationListeners

public Iterator getTableModificationListeners()

getTableProperties

public Properties getTableProperties()

getType

public final String getType()

getUpdateSQL

protected String getUpdateSQL()

hasColumn

public boolean hasColumn(ColumnIdentifier id)

hasIndex

public boolean hasIndex(String name)

isColumnIndexed

public boolean isColumnIndexed(Column column)

isPrimaryKeyConstraintExists

public boolean isPrimaryKeyConstraintExists(String columnName)

isUniqueConstraintExists

public boolean isUniqueConstraintExists(String columnName)
check if unique constraint exists on a column

Parameters: columnName name of the column

Returns: true if uniqueConstraint exists on the column

loadExternalTable

public boolean loadExternalTable(Properties props)

makeRowDecorator

public RowDecorator makeRowDecorator()

makeTransactableTable

public TransactableTable makeTransactableTable()

migrate

public void migrate()

populateIndex

public void populateIndex(Index index)

remount

public void remount()

remount

public void remount(File dir, boolean datafilesonly)

removeConstraint

public Constraint removeConstraint(String name)

removeIndex

public void removeIndex(Index index)

removeTableModificationListener

public void removeTableModificationListener(TableModificationListener listener)

rename

public void rename(String oldName, String newName)

rollback

public void rollback()

setDeferAllConstraints

public void setDeferAllConstraints(boolean deferAll)

setSequence

public void setSequence(Sequence seq)

setUp

protected void setUp(DatabaseLink server)

shutdown

public void shutdown()

toString

public String toString()

truncate

public void truncate()

updateRow

public void updateRow(Row oldrow, Row newrow)

updateRow

public void updateRow(Row oldrow, Row newrow, List cols)