public class GTPrivMapDataSource extends Object
This table provides a convenient way to join the system grant table and 'expand' the privs that are allowed though it.
Constructor and Description |
---|
GTPrivMapDataSource(DatabaseConnection connection)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addRootLock()
Puts this source under a 'root lock'.
|
int |
addRow(RowData row_data)
Adds a row to the source.
|
protected static DataTableColumnDef |
booleanColumn(String name) |
protected TObject |
columnValue(int column,
Object ob)
Returns a TObject that represents a value for the given column in this
table.
|
void |
constraintIntegrityCheck()
Performs all constraint integrity checks and actions to any modifications
based on any changes that happened to the table since that last call to
this method.
|
protected static DataTableColumnDef |
dateColumn(String name) |
void |
dispose()
Disposes this table data source.
|
void |
flushIndexChanges()
Flushes all changes made on this MutableTableDataSource to the backing
index scheme (IndexSet).
|
TObject |
getCellContents(int column,
int row)
Returns an object that represents the information in the given cell
in the table.
|
SelectableScheme |
getColumnScheme(int column)
Returns the SelectableScheme that we use as an index for rows in the
given column of this source.
|
DataTableDef |
getDataTableDef()
Returns a DataTableDef object that defines the layout of the table that
this data is in.
|
com.mckoi.database.MasterTableJournal |
getJournal()
Returns a journal that details the changes to this data source since it
was created.
|
int |
getRowCount()
Returns the number of rows in this data source.
|
TransactionSystem |
getSystem()
Returns the TransactionSystem object that describes global properties
about the data source that generated this object.
|
protected static DataTableColumnDef |
numericColumn(String name) |
void |
removeRootLock()
Removes a root lock from this source.
|
void |
removeRow(int row_index)
Completely removes a row from the source.
|
RowEnumeration |
rowEnumeration()
Returns an iterator that is used to sequentually step through all valid
rows in this source.
|
protected static DataTableColumnDef |
stringColumn(String name)
Convenience methods for constructing a DataTableDef for the dynamically
generated table.
|
int |
updateRow(int row_index,
RowData row_data)
Updates a row in the source.
|
public GTPrivMapDataSource(DatabaseConnection connection)
public DataTableDef getDataTableDef()
TableDataSource
This may return 'null' if there is no table definition.
getDataTableDef
in interface TableDataSource
public int getRowCount()
TableDataSource
NOTE: Returns 'n' - getCellContents(column, row) is not necessarily valid for row = [0..n]. Use 'rowEnumerator' to generate an iterator for valid row values over this data source.
getRowCount
in interface TableDataSource
public TObject getCellContents(int column, int row)
TableDataSource
getCellContents
in interface TableDataSource
public SelectableScheme getColumnScheme(int column)
TableDataSource
ISSUE: The scheme returned here should not have the 'insert' or 'remove' methods called (ie. it should be considered immutable). Perhaps we should make a MutableSelectableScheme interface to guarentee this constraint.
getColumnScheme
in interface TableDataSource
protected TObject columnValue(int column, Object ob)
public TransactionSystem getSystem()
TableDataSource
getSystem
in interface TableDataSource
public RowEnumeration rowEnumeration()
TableDataSource
Note that this object is only defined if entries in the table are not added/remove during the lifetime of this iterator. If entries are added or removed from the table while this iterator is open, then calls to 'nextRowIndex' will be undefined.
rowEnumeration
in interface TableDataSource
public int addRow(RowData row_data)
MutableTableDataSource
It returns a row index that is used to reference this data in future queries. Throws an exception if the row additional was not possible because of IO reasons.
addRow
in interface MutableTableDataSource
public void removeRow(int row_index)
MutableTableDataSource
Throws an exception if the row index does not reference a valid row within the context of this data source.
removeRow
in interface MutableTableDataSource
public int updateRow(int row_index, RowData row_data)
MutableTableDataSource
It returns a row index for the new updated records. Throws an exception if the row update was not possible because of IO reasons or the row index not being a valid reference to a record in this data source.
updateRow
in interface MutableTableDataSource
public com.mckoi.database.MasterTableJournal getJournal()
MutableTableDataSource
getJournal
in interface MutableTableDataSource
public void flushIndexChanges()
MutableTableDataSource
When this method returns, the backing IndexSet of this view will be completely up to date.
flushIndexChanges
in interface MutableTableDataSource
public void constraintIntegrityCheck()
MutableTableDataSource
Any constraints that are marked as INITIALLY_IMMEDIATE are checked when this is called, otherwise the constraint is checked at commit time.
Any referential actions are performed when this method is called. If a referential action causes a modification to another table, this method is recursively called on the table modified.
If a referential integrity constraint is violated and a referential action is unable to maintain the integrity of the database, any changes made to the table are reverted.
constraintIntegrityCheck
in interface MutableTableDataSource
public void dispose()
MutableTableDataSource
dispose
in interface MutableTableDataSource
public void addRootLock()
MutableTableDataSource
addRootLock
in interface MutableTableDataSource
public void removeRootLock()
MutableTableDataSource
removeRootLock
in interface MutableTableDataSource
protected static DataTableColumnDef stringColumn(String name)
protected static DataTableColumnDef booleanColumn(String name)
protected static DataTableColumnDef numericColumn(String name)
protected static DataTableColumnDef dateColumn(String name)
Copyright © 2015. All rights reserved.