DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Classes | Public Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
Deveel.Data.SystemSchema.TableInfoTable Class Reference
Inheritance diagram for Deveel.Data.SystemSchema.TableInfoTable:
Deveel.Data.Sql.Tables.GeneratedTable Deveel.Data.Sql.Tables.ITable Deveel.Data.Sql.IDbObject

Classes

class  TableInfoObject
 

Public Member Functions

 TableInfoTable (ITransaction transaction)
 
override DataObject GetValue (long rowNumber, int columnOffset)
 Gets a single cell within the table that is located at the given column offset and row. More...
 
- Public Member Functions inherited from Deveel.Data.Sql.Tables.GeneratedTable
IEnumerator< RowGetEnumerator ()
 
virtual ColumnIndex GetIndex (int columnOffset)
 Gets an index for given column that can be used to select values from this table. More...
 
void Dispose ()
 

Properties

ITransaction Transaction [get, private set]
 
override TableInfo TableInfo [get]
 
override int RowCount [get]
 
- Properties inherited from Deveel.Data.Sql.Tables.GeneratedTable
IContext Context [get, private set]
 
ObjectName IDbObject. FullName [get]
 
DbObjectType IDbObject. ObjectType [get]
 
abstract TableInfo TableInfo [get]
 
abstract int RowCount [get]
 
- Properties inherited from Deveel.Data.Sql.Tables.ITable
IContext Context [get]
 
TableInfo TableInfo [get]
 Gets the metadata information of the table, used to resolve the column sources. More...
 
int RowCount [get]
 Gets the total number of rows in the table. More...
 
- Properties inherited from Deveel.Data.Sql.IDbObject
ObjectName FullName [get]
 Gets the fully qualified name of the object used to resolve it uniquely within the database. More...
 
DbObjectType ObjectType [get]
 Gets the type of database object that the implementation is for More...
 

Private Member Functions

void Init ()
 

Private Attributes

List< TableInfoObjecttableInfoObjects
 
int rowCount
 

Additional Inherited Members

- Protected Member Functions inherited from Deveel.Data.Sql.Tables.GeneratedTable
 GeneratedTable (IContext dbContext)
 
DataObject GetColumnValue (int column, ISqlObject obj)
 
virtual void Dispose (bool disposing)
 

Detailed Description

Definition at line 431 of file SystemSchema.cs.

Constructor & Destructor Documentation

Deveel.Data.SystemSchema.TableInfoTable.TableInfoTable ( ITransaction  transaction)
inline

Definition at line 435 of file SystemSchema.cs.

436  : base(transaction.Database.Context) {
437  Transaction = transaction;
438  tableInfoObjects = new List<TableInfoObject>();
439 
440  Init();
441  }
The system implementation of a transaction model that handles isolated operations within a database c...
Definition: Transaction.cs:35
IDatabase Database
Gets the database this transaction belongs to.
Definition: ITransaction.cs:48
new IDatabaseContext Context
Gets the context that contains this database.
Definition: IDatabase.cs:50
List< TableInfoObject > tableInfoObjects

Member Function Documentation

override DataObject Deveel.Data.SystemSchema.TableInfoTable.GetValue ( long  rowNumber,
int  columnOffset 
)
inlinevirtual

Gets a single cell within the table that is located at the given column offset and row.

Parameters
rowNumberThe unique number of the row where the cell is located.
columnOffsetThe zero-based offset of the column of the cell to return.
Returns
Returns an instance of DataObject that is contained in the cell located by the row and column coordinates provided.
Exceptions
ArgumentOutOfRangeExceptionIf the given columnOffset is less than zero or greater or equal than the number of columns defined in the table metadata.
See also
Tables.TableInfo.IndexOfColumn(string)

Implements Deveel.Data.Sql.Tables.GeneratedTable.

Definition at line 476 of file SystemSchema.cs.

476  {
477  if (rowNumber < 0 || rowNumber >= tableInfoObjects.Count)
478  throw new ArgumentOutOfRangeException("rowNumber");
479 
480  var tableInfo = tableInfoObjects[(int) rowNumber];
481 
482  switch (columnOffset) {
483  case 0:
484  return DataObject.String(tableInfo.Catalog);
485  case 1:
486  return DataObject.String(tableInfo.Schema);
487  case 2:
488  return DataObject.String(tableInfo.Name);
489  case 3:
490  return DataObject.String(tableInfo.Type);
491  case 4:
492  return DataObject.String(tableInfo.Comments);
493  default:
494  throw new ArgumentOutOfRangeException("columnOffset");
495  }
496  }
List< TableInfoObject > tableInfoObjects
void Deveel.Data.SystemSchema.TableInfoTable.Init ( )
inlineprivate

Definition at line 453 of file SystemSchema.cs.

453  {
454  // All the tables
455  var manager = Transaction.GetTableManager();
456  var tableNames = manager.GetTableNames();
457 
458  var tableList = tableNames.ToArray();
459  Array.Sort(tableList);
460  rowCount = tableList.Length;
461 
462  foreach (var tableName in tableList) {
463  string curType = Transaction.GetTableType(tableName);
464 
465  // If the table is in the SYSTEM schema, the type is defined as a
466  // SYSTEM TABLE.
467  if (curType.Equals("TABLE") &&
468  tableName.Parent.Name.Equals(Name)) {
469  curType = "SYSTEM TABLE";
470  }
471 
472  tableInfoObjects.Add(new TableInfoObject(null, tableName.Parent.Name, tableName.Name, curType, null));
473  }
474  }
The system implementation of a transaction model that handles isolated operations within a database c...
Definition: Transaction.cs:35
List< TableInfoObject > tableInfoObjects
const string Name
The name of the system schema that contains tables referring to system information.

Member Data Documentation

int Deveel.Data.SystemSchema.TableInfoTable.rowCount
private

Definition at line 433 of file SystemSchema.cs.

List<TableInfoObject> Deveel.Data.SystemSchema.TableInfoTable.tableInfoObjects
private

Definition at line 432 of file SystemSchema.cs.

Property Documentation

override int Deveel.Data.SystemSchema.TableInfoTable.RowCount
get

Definition at line 449 of file SystemSchema.cs.

override TableInfo Deveel.Data.SystemSchema.TableInfoTable.TableInfo
get

Definition at line 445 of file SystemSchema.cs.

ITransaction Deveel.Data.SystemSchema.TableInfoTable.Transaction
getprivate set

Definition at line 443 of file SystemSchema.cs.


The documentation for this class was generated from the following file: