DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Properties | Private Attributes | List of all members
Deveel.Data.Transactions.Transaction.TransactionTableContainer Class Reference
Inheritance diagram for Deveel.Data.Transactions.Transaction.TransactionTableContainer:
Deveel.Data.Sql.Tables.ITableContainer

Public Member Functions

 TransactionTableContainer (Transaction transaction, TableInfo[] tableInfos)
 
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...
 
TableInfo GetTableInfo (int offset)
 Gets the information of the table at the given offset in this container. More...
 
string GetTableType (int offset)
 Gets the type of the table at the given offset. More...
 
bool ContainsTable (ObjectName name)
 Checks if a table with the given name is contained in the current context. More...
 
ITable GetTable (int offset)
 Gets the table contained at the given offset within the context. More...
 

Properties

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...
 

Private Attributes

readonly Transaction transaction
 
readonly TableInfo[] tableInfos
 

Detailed Description

Definition at line 267 of file Transaction.cs.

Constructor & Destructor Documentation

Deveel.Data.Transactions.Transaction.TransactionTableContainer.TransactionTableContainer ( Transaction  transaction,
TableInfo[]  tableInfos 
)
inline

Definition at line 271 of file Transaction.cs.

Member Function Documentation

bool Deveel.Data.Transactions.Transaction.TransactionTableContainer.ContainsTable ( ObjectName  name)
inline

Checks if a table with the given name is contained in the current context.

Parameters
nameThe name of the table to search.
Returns
Returns true if any table with the given name was found in the container, false otherwise.

Implements Deveel.Data.Sql.Tables.ITableContainer.

Definition at line 310 of file Transaction.cs.

310  {
311  return FindByName(name) >= 0;
312  }
int FindByName(ObjectName name)
Finds the index in this container of the given table by its name.
Definition: Transaction.cs:280
int Deveel.Data.Transactions.Transaction.TransactionTableContainer.FindByName ( ObjectName  name)
inline

Finds the index in this container of the given table by its name.

Parameters
nameThe name of the table to find.
Returns
Returns a zero-based index that represents the offset of the table identified by the given name within the context, ot -1 of not found.

Implements Deveel.Data.Sql.Tables.ITableContainer.

Definition at line 280 of file Transaction.cs.

280  {
281  var ignoreCase = transaction.IgnoreIdentifiersCase();
282  for (int i = 0; i < tableInfos.Length; i++) {
283  var info = tableInfos[i];
284  if (info != null &&
285  info.TableName.Equals(name, ignoreCase))
286  return i;
287  }
288 
289  return -1;
290  }
ITable Deveel.Data.Transactions.Transaction.TransactionTableContainer.GetTable ( int  offset)
inline

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.Sql.Tables.ITableContainer.

Definition at line 314 of file Transaction.cs.

314  {
315  if (offset == 0)
316  return SystemSchema.GetTableInfoTable(transaction);
317  if (offset == 1)
318  return SystemSchema.GetTableColumnsTable(transaction);
319  if (offset == 2)
320  return SystemSchema.GetProductInfoTable(transaction);
321  if (offset == 3)
322  return SystemSchema.GetVariablesTable(transaction);
323  if (offset == 4)
324  return SystemSchema.GetStatisticsTable(transaction);
325  /*
326  TODO:
327  if (offset == 5)
328  return SystemSchema.GetSessionInfoTable(transaction);
329  */
330  if (offset == 6)
331  return SystemSchema.GetOpenSessionsTable(transaction);
332  if (offset == 7)
333  return SystemSchema.GetSqlTypesTable(transaction);
334  if (offset == 8)
335  return SystemSchema.GetPrivilegesTable(transaction);
336 
337  throw new ArgumentOutOfRangeException("offset");
338  }
TableInfo Deveel.Data.Transactions.Transaction.TransactionTableContainer.GetTableInfo ( int  offset)
inline

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.Sql.Tables.ITableContainer.

Definition at line 299 of file Transaction.cs.

299  {
300  if (offset < 0 || offset >= tableInfos.Length)
301  throw new ArgumentOutOfRangeException("offset");
302 
303  return tableInfos[offset];
304  }
ObjectName Deveel.Data.Transactions.Transaction.TransactionTableContainer.GetTableName ( int  offset)
inline

Gets the name of the table at the given index in this container.

Parameters
offsetThe zero-based offset of the table whose name to return.
Returns
Returns a
See also
ObjectName
that identifies the table.
Exceptions
ArgumentOutOfRangeExceptionIf the given offset is smaller than 0 or greater or equal than TableCount.

Implements Deveel.Data.Sql.Tables.ITableContainer.

Definition at line 292 of file Transaction.cs.

292  {
293  if (offset < 0 || offset >= tableInfos.Length)
294  throw new ArgumentOutOfRangeException("offset");
295 
296  return tableInfos[offset].TableName;
297  }
ObjectName TableName
Gets the fully qualified name of the table that is ensured to be unique within the system...
Definition: TableInfo.cs:97
string Deveel.Data.Transactions.Transaction.TransactionTableContainer.GetTableType ( int  offset)
inline

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.Sql.Tables.ITableContainer.

Definition at line 306 of file Transaction.cs.

306  {
307  return TableTypes.SystemTable;
308  }

Member Data Documentation

readonly TableInfo [] Deveel.Data.Transactions.Transaction.TransactionTableContainer.tableInfos
private

Definition at line 269 of file Transaction.cs.

readonly Transaction Deveel.Data.Transactions.Transaction.TransactionTableContainer.transaction
private

Definition at line 268 of file Transaction.cs.

Property Documentation

int Deveel.Data.Transactions.Transaction.TransactionTableContainer.TableCount
get

Definition at line 276 of file Transaction.cs.


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