Definition at line 28 of file ViewManager.cs.
Deveel.Data.Sql.Views.ViewManager.ViewManager |
( |
ITransaction |
transaction | ) |
|
|
inline |
Definition at line 32 of file ViewManager.cs.
33 if (transaction == null)
34 throw new ArgumentNullException(
"transaction");
37 viewCache =
new Dictionary<long, ViewInfo>();
The system implementation of a transaction model that handles isolated operations within a database c...
void OnCommit(TableCommitInfo obj)
void RegisterOnCommit(Action< TableCommitInfo > action)
Dictionary< long, ViewInfo > viewCache
bool IObjectManager. Deveel.Data.Sql.Views.ViewManager.AlterObject |
( |
IObjectInfo |
objInfo | ) |
|
|
inlineprivate |
Modifies an existing object managed, identified by IObjectInfo.FullName component of the given specification, with the format given.
- Parameters
-
objInfo | The object specification used to alter an existing object. |
- Returns
- Returns
true
an object was identified and successfully altered, or false
if none database object was found for the unique name given.
- Exceptions
-
ArgumentNullException | If the given objInfo object is null . |
ArgumentException | If the type of the object specified (IObjectInfo.ObjectType) is different than the type of objects handled by this manager. |
Implements Deveel.Data.Sql.IObjectManager.
Definition at line 132 of file ViewManager.cs.
133 throw new NotSupportedException();
void Deveel.Data.Sql.Views.ViewManager.Create |
( |
| ) |
|
|
inline |
Initializes the manager into the underlying system.
Typically this method generates the tables required to manage the features relative to the objects.
Implements Deveel.Data.Sql.IObjectManager.
Definition at line 100 of file ViewManager.cs.
101 var tableInfo =
new TableInfo(SystemSchema.ViewTableName);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
The system implementation of a transaction model that handles isolated operations within a database c...
static BinaryType Binary(int maxSize)
static StringType String()
Defines the metadata properties of a table existing within a database.
ITableContainer Deveel.Data.Sql.Views.ViewManager.CreateInternalTableInfo |
( |
| ) |
|
|
inline |
Definition at line 236 of file ViewManager.cs.
237 return new ViewTableContainer(
this);
void IObjectManager. Deveel.Data.Sql.Views.ViewManager.CreateObject |
( |
IObjectInfo |
objInfo | ) |
|
|
inlineprivate |
Create a new object of the ObjectType given the specifications given.
- Parameters
-
objInfo | The object specifications used to create a new object. |
- Exceptions
-
ArgumentNullException | If the given objInfo is null . |
ArgumentException | If the object type of the specification (IObjectInfo.ObjectType) is different than the ObjectType of this manager. |
Implements Deveel.Data.Sql.IObjectManager.
Definition at line 112 of file ViewManager.cs.
113 var viewInfo = objInfo as ViewInfo;
114 if (viewInfo == null)
115 throw new ArgumentException();
void DefineView(ViewInfo viewInfo)
void Deveel.Data.Sql.Views.ViewManager.DefineView |
( |
ViewInfo |
viewInfo | ) |
|
|
inline |
Definition at line 144 of file ViewManager.cs.
145 if (viewInfo == null)
146 throw new ArgumentNullException(
"viewInfo");
148 var dataTableInfo = viewInfo.TableInfo;
149 var viewTable =
Transaction.GetMutableTable(SystemSchema.ViewTableName);
151 var viewName = dataTableInfo.TableName;
152 var query = viewInfo.QueryExpression;
153 var viewInfoData = viewInfo.AsBinary();
156 var rdat = viewTable.NewRow();
157 rdat.SetValue(0, dataTableInfo.SchemaName.Name);
158 rdat.SetValue(1, dataTableInfo.Name);
159 rdat.SetValue(2, query.ToString());
160 rdat.SetValue(3, DataObject.Binary(viewInfoData));
166 if (t.RowCount == 1) {
171 viewTable.AddRow(rdat);
The system implementation of a transaction model that handles isolated operations within a database c...
An event fired when a database object of the given type is created during the lifetime of a transacti...
void RegisterEvent(ITransactionEvent e)
TransactionRegistry Registry
ITable FindViewEntry(ObjectName viewName)
DbObjectType
The kind of objects that can be handled by a database system and its managers
void Deveel.Data.Sql.Views.ViewManager.Dispose |
( |
| ) |
|
|
inline |
void Deveel.Data.Sql.Views.ViewManager.Dispose |
( |
bool |
disposing | ) |
|
|
inlineprivate |
Definition at line 69 of file ViewManager.cs.
The system implementation of a transaction model that handles isolated operations within a database c...
bool IObjectManager. Deveel.Data.Sql.Views.ViewManager.DropObject |
( |
ObjectName |
objName | ) |
|
|
inlineprivate |
Deletes a database object handled by this manager from the system.
- Parameters
-
objName | The unique name of the object to be deleted. |
- Returns
- Returns
true
if a database object was found with the given unique name and successfully deleted from the system, or false
if none object was found.
Implements Deveel.Data.Sql.IObjectManager.
Definition at line 136 of file ViewManager.cs.
bool DropView(ObjectName viewName)
bool Deveel.Data.Sql.Views.ViewManager.DropView |
( |
ObjectName |
viewName | ) |
|
|
inline |
Definition at line 218 of file ViewManager.cs.
219 var table =
Transaction.GetMutableTable(SystemSchema.ViewTableName);
The system implementation of a transaction model that handles isolated operations within a database c...
void RegisterEvent(ITransactionEvent e)
TransactionRegistry Registry
ITable FindViewEntry(ObjectName viewName)
DbObjectType
The kind of objects that can be handled by a database system and its managers
Definition at line 77 of file ViewManager.cs.
78 var table =
Transaction.GetTable(SystemSchema.ViewTableName);
80 var schemav = table.GetResolvedColumnName(0);
81 var namev = table.GetResolvedColumnName(1);
83 using (var session =
new SystemSession(
Transaction, SystemSchema.Name)) {
84 using (var query =session.CreateQuery()) {
87 t = t.ExhaustiveSelect(query,
92 throw new ArgumentException(
String.Format(
"Multiple view entries for name '{0}' in the system.", viewName));
A long string in the system.
The system implementation of a transaction model that handles isolated operations within a database c...
static SqlBinaryExpression Equal(SqlExpression left, SqlExpression right)
SqlExpressionType
All the possible type of SqlExpression supported
static SqlReferenceExpression Reference(ObjectName objectName)
Defines the base class for instances that represent SQL expression tree nodes.
static SqlConstantExpression Constant(object value)
Gets a database object managed by this manager.
- Parameters
-
objName | The name that uniquely identifies the object to get. |
- Returns
- Returns a IDbObject instance that is identified by the given unique name, or
null
if this manager was not able to map any object to the name specified.
Implements Deveel.Data.Sql.IObjectManager.
Definition at line 128 of file ViewManager.cs.
View GetView(ObjectName viewName)
Definition at line 180 of file ViewManager.cs.
181 var viewTable =
Transaction.GetTable(SystemSchema.ViewTableName);
182 var e = viewTable.GetEnumerator();
183 while (e.MoveNext()) {
184 int row = e.Current.RowId.RowNumber;
186 var cSchema = viewTable.GetValue(row, 0).Value.ToString();
187 var cName = viewTable.GetValue(row, 1).Value.ToString();
189 if (viewName.ParentName.Equals(cSchema) &&
190 viewName.Name.Equals(cName)) {
193 if (!
viewCache.TryGetValue(row, out viewInfo)) {
194 var blob = (
SqlBinary)viewTable.GetValue(row, 3).Value;
195 using (var session =
new SystemSession(
Transaction, SystemSchema.Name)) {
196 using (var context = session.CreateQuery()) {
198 viewInfo = ViewInfo.Deserialize(blob.GetInput());
206 return new View(viewInfo);
The system implementation of a transaction model that handles isolated operations within a database c...
Implements a BINARY object that handles a limited number of bytes, not exceding MaxLength.
A VIEW object obtained by a source query.
Dictionary< long, ViewInfo > viewCache
View Deveel.Data.Sql.Views.ViewManager.GetViewAt |
( |
int |
offset | ) |
|
|
inlineprivate |
Definition at line 240 of file ViewManager.cs.
241 var table =
Transaction.GetTable(SystemSchema.ViewTableName);
243 throw new DatabaseSystemException(
String.Format(
"System table '{0}' was not defined.", SystemSchema.ViewTableName));
245 var e = table.GetEnumerator();
247 while (e.MoveNext()) {
248 var row = e.Current.RowId.RowNumber;
252 if (!
viewCache.TryGetValue(row, out viewInfo)) {
253 var binary = (
ISqlBinary)table.GetValue(row, 3).Value;
255 using (var session =
new SystemSession(
Transaction, SystemSchema.Name)) {
256 using (var context = session.CreateQuery()) {
257 viewInfo = ViewInfo.Deserialize(binary.GetInput());
264 return new View(viewInfo);
270 throw new ArgumentOutOfRangeException(
"offset");
A long string in the system.
The system implementation of a transaction model that handles isolated operations within a database c...
A VIEW object obtained by a source query.
Defines the required contract of a SQL BINARY object
Dictionary< long, ViewInfo > viewCache
void Deveel.Data.Sql.Views.ViewManager.InvalidateViewCache |
( |
| ) |
|
|
inlineprivate |
Definition at line 58 of file ViewManager.cs.
Dictionary< long, ViewInfo > viewCache
bool IObjectManager. Deveel.Data.Sql.Views.ViewManager.ObjectExists |
( |
ObjectName |
objName | ) |
|
|
inlineprivate |
Checks if an object identified by the given name is managed by this instance.
- Parameters
-
objName | The name that uniquely identifies the object. |
- Returns
Implements Deveel.Data.Sql.IObjectManager.
Definition at line 124 of file ViewManager.cs.
bool ViewExists(ObjectName viewName)
Definition at line 42 of file ViewManager.cs.
43 if (!obj.
TableName.Equals(SystemSchema.ViewTableName))
IEnumerable< int > AddedRows
void InvalidateViewCache()
IEnumerable< int > RemovedRows
bool IObjectManager. Deveel.Data.Sql.Views.ViewManager.RealObjectExists |
( |
ObjectName |
objName | ) |
|
|
inlineprivate |
Checks if an object really exists in the system.
- Parameters
-
objName | The unique name of the object to check. |
- Returns
- Returns
true
if an object with the given name concretely exists in the system, or false
otherwise.
Implements Deveel.Data.Sql.IObjectManager.
Definition at line 120 of file ViewManager.cs.
bool ViewExists(ObjectName viewName)
Normalizes the input object name using the case sensitivity specified.
- Parameters
-
objName | The input object name, that can be partial or complete, to be normalized to the real name of an object. |
ignoreCase | The case sensitivity specification used to compare the input name with the names of the existing objects handled by this manager. |
- Returns
- Returns the fully normalized ObjectName that is the real name of an object matching the input name, or
null
if the input name was not possible to be resolved.
Implements Deveel.Data.Sql.IObjectManager.
Definition at line 140 of file ViewManager.cs.
141 throw new NotImplementedException();
bool Deveel.Data.Sql.Views.ViewManager.ViewExists |
( |
ObjectName |
viewName | ) |
|
|
inline |
Definition at line 214 of file ViewManager.cs.
int RowCount
Gets the total number of rows in the table.
ITable FindViewEntry(ObjectName viewName)
Dictionary<long, ViewInfo> Deveel.Data.Sql.Views.ViewManager.viewCache |
|
private |
bool Deveel.Data.Sql.Views.ViewManager.viewTableChanged |
|
private |
DbObjectType IObjectManager. Deveel.Data.Sql.Views.ViewManager.ObjectType |
|
getprivate |
The documentation for this class was generated from the following file:
- /var/calculate/remote/distfiles/egit-src/deveeldb.git/src/deveeldb/Deveel.Data.Sql.Views/ViewManager.cs