DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Classes | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Sql.Tables.Table Class Referenceabstract
Inheritance diagram for Deveel.Data.Sql.Tables.Table:
Deveel.Data.Sql.Tables.IQueryTable Deveel.Data.Transactions.ILockable Deveel.Data.Sql.Tables.ITable Deveel.Data.Sql.IDbObject Deveel.Data.Sql.Tables.CompositeTable Deveel.Data.Sql.Tables.FilterTable Deveel.Data.Sql.Tables.JoinedTable Deveel.Data.Sql.Tables.RootTable Deveel.Data.Sql.Tables.LimitedTable Deveel.Data.Sql.Tables.ReferenceTable Deveel.Data.Sql.Tables.SubsetColumnTable Deveel.Data.Sql.Tables.NaturallyJoinedTable Deveel.Data.Sql.Tables.VirtualTable Deveel.Data.Sql.Tables.BaseDataTable Deveel.Data.Sql.Tables.OuterTable Deveel.Data.Sql.Tables.FunctionTable Deveel.Data.Sql.Tables.TemporaryTable Deveel.Data.Sql.Tables.UserContextTable

Classes

class  TableVariableResolver
 

Public Member Functions

abstract IEnumerator< RowGetEnumerator ()
 
void Dispose ()
 
abstract void Lock ()
 
abstract void Release ()
 
abstract DataObject GetValue (long rowNumber, int columnOffset)
 Gets a single cell within the table that is located at the given column offset and row. More...
 
ColumnIndex GetIndex (int columnOffset)
 Gets an index for given column that can be used to select values from this table. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 
virtual void OnLockAcquired (Lock @lock)
 
virtual void OnLockReleased (Lock @lock)
 
virtual int IndexOfColumn (ObjectName columnName)
 
virtual ObjectName GetResolvedColumnName (int column)
 
virtual ColumnIndex GetIndex (int column, int originalColumn, ITable table)
 
abstract IEnumerable< int > ResolveRows (int column, IEnumerable< int > rowSet, ITable ancestor)
 
abstract RawTableInfo GetRawTableInfo (RawTableInfo rootInfo)
 
int FindColumn (ObjectName columnName)
 

Properties

abstract IContext Context [get]
 
abstract TableInfo TableInfo [get]
 
bool IsLocked [get, private set]
 
object ILockable. RefId [get]
 
int IQueryTable. ColumnCount [get]
 
virtual int ColumnCount [get]
 
abstract int RowCount [get]
 
ObjectName FullName [get]
 
DbObjectType IDbObject. ObjectType [get]
 
- Properties inherited from Deveel.Data.Sql.Tables.IQueryTable
int ColumnCount [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...
 
- Properties inherited from Deveel.Data.Transactions.ILockable
object RefId [get]
 

Private Member Functions

 ~Table ()
 
IEnumerator IEnumerable. GetEnumerator ()
 
void ILockable. Acquired (Lock @lock)
 
void ILockable. Released (Lock @lock)
 
ObjectName IQueryTable. GetResolvedColumnName (int column)
 
ColumnIndex IQueryTable. GetIndex (int column, int originalColumn, ITable table)
 
IEnumerable< int > IQueryTable. ResolveRows (int columnOffset, IEnumerable< int > rows, ITable ancestor)
 
RawTableInfo IQueryTable. GetRawTableInfo (RawTableInfo rootInfo)
 
int IQueryTable. FindColumn (ObjectName columnName)
 
SqlType GetColumnType (int columnOffset)
 
SqlType GetColumnType (ObjectName columnName)
 
ITableVariableResolver IQueryTable. GetVariableResolver ()
 

Private Attributes

Dictionary< ObjectName, int > colNameLookup
 
readonly object colLookupLock = new object()
 

Detailed Description

Definition at line 26 of file Table.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Tables.Table.~Table ( )
inlineprivate

Definition at line 31 of file Table.cs.

31  {
32  Dispose(false);
33  }

Member Function Documentation

void ILockable. Deveel.Data.Sql.Tables.Table.Acquired ( Lock lock)
inlineprivate

Implements Deveel.Data.Transactions.ILockable.

Definition at line 81 of file Table.cs.

81  {
82  try {
83  OnLockAcquired(@lock);
84  } finally {
85  IsLocked = true;
86  }
87  }
virtual void OnLockAcquired(Lock @lock)
Definition: Table.cs:73
void Deveel.Data.Sql.Tables.Table.Dispose ( )
inline

Definition at line 41 of file Table.cs.

41  {
42  Dispose(true);
43  GC.SuppressFinalize(this);
44  }
virtual void Deveel.Data.Sql.Tables.Table.Dispose ( bool  disposing)
inlineprotectedvirtual

Reimplemented in Deveel.Data.Sql.Tables.UserContextTable.

Definition at line 46 of file Table.cs.

46  {
47  }
int Deveel.Data.Sql.Tables.Table.FindColumn ( ObjectName  columnName)
inlineprotected

Implements Deveel.Data.Sql.Tables.IQueryTable.

Definition at line 143 of file Table.cs.

143  {
144  lock (colLookupLock) {
145  if (colNameLookup == null)
146  colNameLookup = new Dictionary<ObjectName, int>(30);
147 
148  int index;
149  if (!colNameLookup.TryGetValue(columnName, out index)) {
150  index = IndexOfColumn(columnName);
151  colNameLookup[columnName] = index;
152  }
153 
154  return index;
155  }
156  }
virtual int IndexOfColumn(ObjectName columnName)
Definition: Table.cs:97
Dictionary< ObjectName, int > colNameLookup
Definition: Table.cs:28
readonly object colLookupLock
Definition: Table.cs:29
int IQueryTable. Deveel.Data.Sql.Tables.Table.FindColumn ( ObjectName  columnName)
inlineprivate

Implements Deveel.Data.Sql.Tables.IQueryTable.

Definition at line 158 of file Table.cs.

158  {
159  return FindColumn(columnName);
160  }
int FindColumn(ObjectName columnName)
Definition: Table.cs:143
SqlType Deveel.Data.Sql.Tables.Table.GetColumnType ( int  columnOffset)
inlineprivate

Definition at line 162 of file Table.cs.

162  {
163  return TableInfo[columnOffset].ColumnType;
164  }
abstract TableInfo TableInfo
Definition: Table.cs:51
SqlType Deveel.Data.Sql.Tables.Table.GetColumnType ( ObjectName  columnName)
inlineprivate

Definition at line 166 of file Table.cs.

166  {
167  return GetColumnType(FindColumn(columnName));
168  }
int FindColumn(ObjectName columnName)
Definition: Table.cs:143
SqlType GetColumnType(int columnOffset)
Definition: Table.cs:162
abstract IEnumerator<Row> Deveel.Data.Sql.Tables.Table.GetEnumerator ( )
pure virtual
IEnumerator IEnumerable. Deveel.Data.Sql.Tables.Table.GetEnumerator ( )
inlineprivate

Definition at line 37 of file Table.cs.

37  {
38  return GetEnumerator();
39  }
abstract IEnumerator< Row > GetEnumerator()
ColumnIndex IQueryTable. Deveel.Data.Sql.Tables.Table.GetIndex ( int  column,
int  originalColumn,
ITable  table 
)
inlineprivate

Implements Deveel.Data.Sql.Tables.IQueryTable.

Definition at line 109 of file Table.cs.

109  {
110  return GetIndex(column, originalColumn, table);
111  }
ColumnIndex IQueryTable. GetIndex(int column, int originalColumn, ITable table)
Definition: Table.cs:109
virtual ColumnIndex Deveel.Data.Sql.Tables.Table.GetIndex ( int  column,
int  originalColumn,
ITable  table 
)
inlineprotectedvirtual
ColumnIndex Deveel.Data.Sql.Tables.Table.GetIndex ( int  columnOffset)
inline

Gets an index for given column that can be used to select values from this table.

Parameters
columnOffsetThe zero-based offset of the column which to get the index.
Returns
Returns an instance of ColumnIndex that is used to select a subset of rows from the table.

Implements Deveel.Data.Sql.Tables.ITable.

Definition at line 131 of file Table.cs.

131  {
132  return GetIndex(columnOffset, columnOffset, this);
133  }
ColumnIndex IQueryTable. GetIndex(int column, int originalColumn, ITable table)
Definition: Table.cs:109
abstract RawTableInfo Deveel.Data.Sql.Tables.Table.GetRawTableInfo ( RawTableInfo  rootInfo)
protectedpure virtual
RawTableInfo IQueryTable. Deveel.Data.Sql.Tables.Table.GetRawTableInfo ( RawTableInfo  rootInfo)
inlineprivate

Implements Deveel.Data.Sql.Tables.IQueryTable.

Definition at line 125 of file Table.cs.

125  {
126  return GetRawTableInfo(rootInfo);
127  }
abstract RawTableInfo GetRawTableInfo(RawTableInfo rootInfo)
virtual ObjectName Deveel.Data.Sql.Tables.Table.GetResolvedColumnName ( int  column)
inlineprotectedvirtual
ObjectName IQueryTable. Deveel.Data.Sql.Tables.Table.GetResolvedColumnName ( int  column)
inlineprivate

Implements Deveel.Data.Sql.Tables.IQueryTable.

Definition at line 105 of file Table.cs.

105  {
106  return GetResolvedColumnName(column);
107  }
virtual ObjectName GetResolvedColumnName(int column)
Definition: Table.cs:101
abstract DataObject Deveel.Data.Sql.Tables.Table.GetValue ( long  rowNumber,
int  columnOffset 
)
pure virtual

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

Implemented in Deveel.Data.Sql.Tables.JoinedTable, Deveel.Data.Sql.Tables.FunctionTable, Deveel.Data.Sql.Tables.CompositeTable, Deveel.Data.Sql.Tables.SubsetColumnTable, Deveel.Data.Sql.Tables.FilterTable, Deveel.Data.Sql.Tables.OuterTable, Deveel.Data.Sql.Tables.TemporaryTable, Deveel.Data.Sql.Tables.UserContextTable, and Deveel.Data.Sql.Tables.LimitedTable.

ITableVariableResolver IQueryTable. Deveel.Data.Sql.Tables.Table.GetVariableResolver ( )
inlineprivate

Implements Deveel.Data.Sql.Tables.IQueryTable.

Definition at line 170 of file Table.cs.

170  {
171  return new TableVariableResolver(this);
172  }
virtual int Deveel.Data.Sql.Tables.Table.IndexOfColumn ( ObjectName  columnName)
inlineprotectedvirtual

Reimplemented in Deveel.Data.Sql.Tables.JoinedTable, Deveel.Data.Sql.Tables.CompositeTable, Deveel.Data.Sql.Tables.SubsetColumnTable, Deveel.Data.Sql.Tables.BaseDataTable, and Deveel.Data.Sql.Tables.ReferenceTable.

Definition at line 97 of file Table.cs.

97  {
98  return TableInfo.IndexOfColumn(columnName.Name);
99  }
int IndexOfColumn(string columnName)
Gets the offset of the column with the given name.
Definition: TableInfo.cs:310
abstract TableInfo TableInfo
Definition: Table.cs:51
abstract void Deveel.Data.Sql.Tables.Table.Lock ( )
pure virtual
virtual void Deveel.Data.Sql.Tables.Table.OnLockAcquired ( Lock lock)
inlineprotectedvirtual

Definition at line 73 of file Table.cs.

73  {
74  Lock();
75  }
virtual void Deveel.Data.Sql.Tables.Table.OnLockReleased ( Lock lock)
inlineprotectedvirtual

Definition at line 77 of file Table.cs.

77  {
78  Release();
79  }
abstract void Deveel.Data.Sql.Tables.Table.Release ( )
pure virtual
void ILockable. Deveel.Data.Sql.Tables.Table.Released ( Lock lock)
inlineprivate

Implements Deveel.Data.Transactions.ILockable.

Definition at line 89 of file Table.cs.

89  {
90  try {
91  OnLockReleased(@lock);
92  } finally {
93  IsLocked = true;
94  }
95  }
virtual void OnLockReleased(Lock @lock)
Definition: Table.cs:77
abstract IEnumerable<int> Deveel.Data.Sql.Tables.Table.ResolveRows ( int  column,
IEnumerable< int >  rowSet,
ITable  ancestor 
)
protectedpure virtual
IEnumerable<int> IQueryTable. Deveel.Data.Sql.Tables.Table.ResolveRows ( int  columnOffset,
IEnumerable< int >  rows,
ITable  ancestor 
)
inlineprivate

Implements Deveel.Data.Sql.Tables.IQueryTable.

Definition at line 119 of file Table.cs.

119  {
120  return ResolveRows(columnOffset, rows, ancestor);
121  }
abstract IEnumerable< int > ResolveRows(int column, IEnumerable< int > rowSet, ITable ancestor)

Member Data Documentation

readonly object Deveel.Data.Sql.Tables.Table.colLookupLock = new object()
private

Definition at line 29 of file Table.cs.

Dictionary<ObjectName, int> Deveel.Data.Sql.Tables.Table.colNameLookup
private

Definition at line 28 of file Table.cs.

Property Documentation

int IQueryTable. Deveel.Data.Sql.Tables.Table.ColumnCount
getprivate

Definition at line 59 of file Table.cs.

virtual int Deveel.Data.Sql.Tables.Table.ColumnCount
getprotected

Definition at line 63 of file Table.cs.

abstract IContext Deveel.Data.Sql.Tables.Table.Context
get

Definition at line 49 of file Table.cs.

ObjectName Deveel.Data.Sql.Tables.Table.FullName
get

Definition at line 135 of file Table.cs.

bool Deveel.Data.Sql.Tables.Table.IsLocked
getprivate set

Definition at line 53 of file Table.cs.

DbObjectType IDbObject. Deveel.Data.Sql.Tables.Table.ObjectType
getprivate

Definition at line 139 of file Table.cs.

object ILockable. Deveel.Data.Sql.Tables.Table.RefId
getprivate

Definition at line 55 of file Table.cs.

abstract int Deveel.Data.Sql.Tables.Table.RowCount
get

Definition at line 67 of file Table.cs.

abstract TableInfo Deveel.Data.Sql.Tables.Table.TableInfo
get

Definition at line 51 of file Table.cs.


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