DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Classes | Public Member Functions | Static Private Member Functions | List of all members
Deveel.Data.Sql.Triggers.TriggerManager.TriggersTableContainer Class Reference
Inheritance diagram for Deveel.Data.Sql.Triggers.TriggerManager.TriggersTableContainer:
Deveel.Data.SystemTableContainer Deveel.Data.Sql.Tables.ITableContainer

Classes

class  TriggerTable
 

Public Member Functions

 TriggersTableContainer (ITransaction transaction)
 
override TableInfo GetTableInfo (int offset)
 Gets the information of the table at the given offset in this container. More...
 
override string GetTableType (int offset)
 Gets the type of the table at the given offset. More...
 
override ITable GetTable (int offset)
 Gets the table contained at the given offset within the context. More...
 
- Public Member Functions inherited from Deveel.Data.SystemTableContainer
int FindByName (ObjectName name)
 Finds the index in this container of the given table by its name. More...
 
ObjectName GetTableName (int offset)
 Gets the name of the table at the given index in this container. More...
 
bool ContainsTable (ObjectName name)
 Checks if a table with the given name is contained in the current context. More...
 

Static Private Member Functions

static TableInfo CreateTableInfo (string schema, string name)
 

Additional Inherited Members

- Protected Member Functions inherited from Deveel.Data.SystemTableContainer
 SystemTableContainer (ITransaction transaction, ObjectName tableName)
 
- Properties inherited from Deveel.Data.SystemTableContainer
ITransaction Transaction [get, private set]
 
ObjectName TableName [get, private set]
 
int TableCount [get]
 
- Properties inherited from Deveel.Data.Sql.Tables.ITableContainer
int TableCount [get]
 Returns the total count of tables that this object is maintaining. More...
 

Detailed Description

Definition at line 358 of file TriggerManager.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Triggers.TriggerManager.TriggersTableContainer.TriggersTableContainer ( ITransaction  transaction)
inline

Definition at line 359 of file TriggerManager.cs.

360  : base(transaction, SystemSchema.TriggerTableName) {
361  }

Member Function Documentation

static TableInfo Deveel.Data.Sql.Triggers.TriggerManager.TriggersTableContainer.CreateTableInfo ( string  schema,
string  name 
)
inlinestaticprivate

Definition at line 372 of file TriggerManager.cs.

372  {
373  var tableInfo = new TableInfo(new ObjectName(new ObjectName(schema), name));
374 
375  tableInfo.AddColumn("type", PrimitiveTypes.Numeric());
376  tableInfo.AddColumn("on_object", PrimitiveTypes.String());
377  tableInfo.AddColumn("routine_name", PrimitiveTypes.String());
378  tableInfo.AddColumn("param_args", PrimitiveTypes.String());
379  tableInfo.AddColumn("owner", PrimitiveTypes.String());
380 
381  return tableInfo.AsReadOnly();
382  }
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static NumericType Numeric()
Defines the metadata properties of a table existing within a database.
Definition: TableInfo.cs:41
override ITable Deveel.Data.Sql.Triggers.TriggerManager.TriggersTableContainer.GetTable ( int  offset)
inlinevirtual

Gets the table contained at the given offset within the context.

Parameters
offsetThe zero-based offset of the table to return.
Returns
Returns an instance of ITable that provides access to the backed informaion for an object provided by the context.
Exceptions
ArgumentOutOfRangeExceptionIf the given offset is smaller than 0 or greater or equal than TableCount.

Implements Deveel.Data.SystemTableContainer.

Definition at line 385 of file TriggerManager.cs.

385  {
386  var table = Transaction.GetTable(SystemSchema.TriggerTableName);
387  var enumerator = table.GetEnumerator();
388  int p = 0;
389  int i;
390  int rowIndex = -1;
391  while (enumerator.MoveNext()) {
392  i = enumerator.Current.RowId.RowNumber;
393  if (p == offset) {
394  rowIndex = i;
395  } else {
396  ++p;
397  }
398  }
399 
400  if (p != offset)
401  throw new ArgumentOutOfRangeException("offset");
402 
403  var schema = table.GetValue(rowIndex, 0).Value.ToString();
404  var name = table.GetValue(rowIndex, 1).Value.ToString();
405 
406  var tableInfo = CreateTableInfo(schema, name);
407 
408  var type = table.GetValue(rowIndex, 2);
409  var tableName = table.GetValue(rowIndex, 3);
410  var routine = table.GetValue(rowIndex, 4);
411  var args = table.GetValue(rowIndex, 5);
412  var owner = table.GetValue(rowIndex, 6);
413 
414  return new TriggerTable(Transaction, tableInfo) {
415  Type = type,
416  TableName = tableName,
417  Routine = routine,
418  Arguments = args,
419  Owner = owner
420  };
421  }
static TableInfo CreateTableInfo(string schema, string name)
The system implementation of a transaction model that handles isolated operations within a database c...
Definition: Transaction.cs:35
A routine (PROCEDURE or FUNCTION) defined in a database, that is a program with defined input paramet...
A user-defined TYPE that holds complex objects in a database column.
override TableInfo Deveel.Data.Sql.Triggers.TriggerManager.TriggersTableContainer.GetTableInfo ( int  offset)
inlinevirtual

Gets the information of the table at the given offset in this container.

Parameters
offsetThe zero-based offset of the table whose information to return.
Returns
Returns an instance of
See also
TableInfo
that describes the metadata of a table at the given offset within the context.
Exceptions
ArgumentOutOfRangeExceptionIf the given offset is smaller than 0 or greater or equal than TableCount.

Implements Deveel.Data.SystemTableContainer.

Definition at line 363 of file TriggerManager.cs.

363  {
364  var triggerName = GetTableName(offset);
365  return CreateTableInfo(triggerName.ParentName, triggerName.Name);
366  }
static TableInfo CreateTableInfo(string schema, string name)
ObjectName GetTableName(int offset)
Gets the name of the table at the given index in this container.
override string Deveel.Data.Sql.Triggers.TriggerManager.TriggersTableContainer.GetTableType ( int  offset)
inlinevirtual

Gets the type of the table at the given offset.

Parameters
offsetThe zero-based offset of the table whose type to return.
Returns
Returns a String that describes the type of table at the given offset.
Exceptions
ArgumentOutOfRangeExceptionIf the given offset is smaller than 0 or greater or equal than TableCount.

Implements Deveel.Data.SystemTableContainer.

Definition at line 368 of file TriggerManager.cs.

368  {
369  return TableTypes.Trigger;
370  }

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