DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
PersistentVariableManager.cs
Go to the documentation of this file.
1 //
2 // Copyright 2010-2015 Deveel
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 using System;
18 
20 using Deveel.Data.Types;
21 
22 namespace Deveel.Data.Sql.Variables {
25  Transaction = transaction;
26  }
27 
28  public ITransaction Transaction { get; private set; }
29 
30 
32  get { return DbObjectType.Variable; }
33  }
34 
36  //TODO:
37  }
38 
40  var variableInfo = objInfo as VariableInfo;
41  if (variableInfo == null)
42  throw new ArgumentException();
43 
44  DefineVariable(variableInfo);
45  }
46 
48  return (this as IObjectManager).ObjectExists(objName);
49  }
50 
52  if (objName == null)
53  throw new ArgumentNullException("objName");
54 
55  if (objName.Parent != null)
56  throw new ArgumentException();
57 
58  return VariableExists(objName.Name);
59  }
60 
61  public Variable DefineVariable(VariableInfo variableInfo) {
62  throw new NotImplementedException();
63  }
64 
65  public bool VariableExists(string name) {
66  return VariableExists(name, Transaction.IgnoreIdentifiersCase());
67  }
68 
69  public bool DropVariable(string variableName) {
70  throw new NotImplementedException();
71  }
72 
73  public Variable GetVariable(string variableName) {
74  throw new NotImplementedException();
75  }
76 
78  if (objName == null)
79  throw new ArgumentNullException("objName");
80 
81  if (objName.Parent != null)
82  throw new ArgumentException();
83 
84  return GetVariable(objName.Name);
85  }
86 
88  throw new NotSupportedException();
89  }
90 
92  if (objName == null)
93  throw new ArgumentNullException("objName");
94 
95  if (objName.Parent != null)
96  throw new ArgumentException();
97 
98  return DropVariable(objName.Name);
99  }
100 
101  ObjectName IObjectManager.ResolveName(ObjectName objName, bool ignoreCase) {
102  if (objName.Parent != null)
103  return null;
104 
105  if (VariableExists(objName.Name, ignoreCase))
106  return new ObjectName(objName.Name);
107 
108  return null;
109  }
110 
111  private bool VariableExists(string name, bool ignoreCase) {
112  throw new NotImplementedException();
113  }
114 
116  if (!VariableExists(variable.Name))
117  return null;
118 
119  throw new NotImplementedException();
120  }
121 
123  if (!VariableExists(variable.Name))
124  return null;
125 
126  throw new NotImplementedException();
127  }
128 
129  public void Dispose() {
130  Transaction = null;
131  }
132  }
133 }
DataObject Resolve(ObjectName variable)
Returns the value of a given variable.
bool AlterObject(IObjectInfo objInfo)
Modifies an existing object managed, identified by IObjectInfo.FullName component of the given specif...
bool DropObject(ObjectName objName)
Deletes a database object handled by this manager from the system.
void Create()
Initializes the manager into the underlying system.
The system implementation of a transaction model that handles isolated operations within a database c...
Definition: Transaction.cs:35
bool RealObjectExists(ObjectName objName)
Checks if an object really exists in the system.
Represents a database object, such as a table, a trigger, a type or a column.
Definition: IDbObject.cs:24
Describes the name of an object within a database.
Definition: ObjectName.cs:44
void CreateObject(IObjectInfo objInfo)
Create a new object of the ObjectType given the specifications given.
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
Definition: DataObject.cs:35
Defines the properties of a specific SQL Type and handles the values compatible.
Definition: SqlType.cs:33
DbObjectType ObjectType
Gets the type of objects managed by this instance.
An interface to resolve a variable name to a constant object.
ObjectName Parent
Gets the parent reference of the current one, if any or null if none.
Definition: ObjectName.cs:99
string Name
Gets the name of the object being referenced.
Definition: ObjectName.cs:108
IDbObject GetObject(ObjectName objName)
Gets a database object managed by this manager.
bool ObjectExists(ObjectName objName)
Checks if an object identified by the given name is managed by this instance.
SqlType ReturnType(ObjectName variable)
Returns the SqlType of object the given variable is.
Defines the contract for the business managers of database objects of a given type.
The simplest implementation of a transaction.
Definition: ITransaction.cs:30
DbObjectType
The kind of objects that can be handled by a database system and its managers
Definition: DbObjectType.cs:27
ObjectName ResolveName(ObjectName objName, bool ignoreCase)
Normalizes the input object name using the case sensitivity specified.