Package com.mckoi.database
Class AbstractInternalTableInfo2
- java.lang.Object
-
- com.mckoi.database.AbstractInternalTableInfo2
-
- All Implemented Interfaces:
InternalTableInfo
- Direct Known Subclasses:
ConnectionTriggerManager.TriggerInternalTableInfo
,ProcedureManager.ProcedureInternalTableInfo
,ViewManager.ViewInternalTableInfo
abstract class AbstractInternalTableInfo2 extends java.lang.Object implements InternalTableInfo
An implementation of InternalTableInfo that provides a number of methods to aid in the productions of the InternalTableInfo interface for a transaction specific model of a set of tables that is based on a single system table. This would be used to model table views for triggers, views, procedures and sequences all of which are table sets tied to a single table respectively, and the number of items in the table represent the number of tables to model.This abstraction assumes that the name of the schema/table are in columns 0 and 1 of the backed system table.
-
-
Field Summary
Fields Modifier and Type Field Description protected TableName
table_name
The table in the transaction that contains the list of items we are modelling.protected Transaction
transaction
The transaction we are connected to.
-
Constructor Summary
Constructors Constructor Description AbstractInternalTableInfo2(Transaction transaction, TableName table_name)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
containsTableName(TableName name)
Returns true if this container contains a table with the given name.abstract MutableTableDataSource
createInternalTable(int index)
This is the factory method for generating the internal table for the given table in this container.int
findTableName(TableName name)
Finds the index in this container of the given table name, otherwise returns -1.abstract DataTableDef
getDataTableDef(int i)
Returns the DataTableDef object that describes the table at the given index in this container.int
getTableCount()
Returns the number of internal table sources that this object is maintaining.TableName
getTableName(int i)
Returns the name of the table at the given index in this container.abstract java.lang.String
getTableType(int i)
Returns a String that describes the type of the table at the given index.
-
-
-
Field Detail
-
transaction
protected final Transaction transaction
The transaction we are connected to.
-
table_name
protected final TableName table_name
The table in the transaction that contains the list of items we are modelling.
-
-
Constructor Detail
-
AbstractInternalTableInfo2
public AbstractInternalTableInfo2(Transaction transaction, TableName table_name)
Constructor.
-
-
Method Detail
-
getTableCount
public int getTableCount()
Description copied from interface:InternalTableInfo
Returns the number of internal table sources that this object is maintaining.- Specified by:
getTableCount
in interfaceInternalTableInfo
-
findTableName
public int findTableName(TableName name)
Description copied from interface:InternalTableInfo
Finds the index in this container of the given table name, otherwise returns -1.- Specified by:
findTableName
in interfaceInternalTableInfo
-
getTableName
public TableName getTableName(int i)
Description copied from interface:InternalTableInfo
Returns the name of the table at the given index in this container.- Specified by:
getTableName
in interfaceInternalTableInfo
-
containsTableName
public boolean containsTableName(TableName name)
Description copied from interface:InternalTableInfo
Returns true if this container contains a table with the given name.- Specified by:
containsTableName
in interfaceInternalTableInfo
-
getDataTableDef
public abstract DataTableDef getDataTableDef(int i)
Description copied from interface:InternalTableInfo
Returns the DataTableDef object that describes the table at the given index in this container.- Specified by:
getDataTableDef
in interfaceInternalTableInfo
-
getTableType
public abstract java.lang.String getTableType(int i)
Description copied from interface:InternalTableInfo
Returns a String that describes the type of the table at the given index.- Specified by:
getTableType
in interfaceInternalTableInfo
-
createInternalTable
public abstract MutableTableDataSource createInternalTable(int index)
Description copied from interface:InternalTableInfo
This is the factory method for generating the internal table for the given table in this container. This should return an implementation of MutableTableDataSource that is used to represent the internal data being modelled.This method is allowed to throw an exception for table objects that aren't backed by a MutableTableDataSource, such as a view.
- Specified by:
createInternalTable
in interfaceInternalTableInfo
-
-