DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Properties | Private Attributes | List of all members
Deveel.Data.Routines.FunctionProvider.FunctionConfiguration Class Reference
Inheritance diagram for Deveel.Data.Routines.FunctionProvider.FunctionConfiguration:
Deveel.Data.Sql.Fluid.IFunctionConfiguration Deveel.Data.Sql.Fluid.IRoutineConfiguration

Public Member Functions

 FunctionConfiguration (FunctionProvider provider)
 
bool HasParameter (string name)
 
bool HasUnboundedParameter ()
 
IFunctionConfiguration Named (ObjectName name)
 
IFunctionConfiguration OfType (FunctionType functionType)
 
IFunctionConfiguration WithAlias (ObjectName alias)
 
IFunctionConfiguration WithParameter (Action< IFunctionParameterConfiguration > config)
 
IFunctionConfiguration ReturnsType (Func< InvokeContext, SqlType > returns)
 
IFunctionConfiguration WhenExecute (Func< InvokeContext, InvokeResult > execute)
 

Properties

FunctionType FunctionType [get, private set]
 
Func< InvokeContext, SqlTypeReturnTypeFunc [get, private set]
 
Func< InvokeContext, InvokeResultExecuteFunc [get, private set]
 
FunctionInfo[] FunctionInfo [get]
 
ObjectName FunctionName [get, private set]
 
RoutineParameter[] Parameters [get]
 
IConfigurationContext Context [get]
 
- Properties inherited from Deveel.Data.Sql.Fluid.IRoutineConfiguration
IConfigurationContext Context [get]
 

Private Attributes

readonly FunctionProvider provider
 
readonly Dictionary< string, RoutineParameterparameters
 
List< ObjectNamealiases
 

Detailed Description

Definition at line 131 of file FunctionProvider.cs.

Constructor & Destructor Documentation

Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.FunctionConfiguration ( FunctionProvider  provider)
inline

Definition at line 136 of file FunctionProvider.cs.

136  {
137  this.provider = provider;
138  parameters = new Dictionary<string, RoutineParameter>();
139  FunctionType = FunctionType.Static;
140  }
readonly Dictionary< string, RoutineParameter > parameters

Member Function Documentation

bool Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.HasParameter ( string  name)
inline

Definition at line 164 of file FunctionProvider.cs.

164  {
165  return parameters.ContainsKey(name);
166  }
readonly Dictionary< string, RoutineParameter > parameters
bool Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.HasUnboundedParameter ( )
inline

Definition at line 168 of file FunctionProvider.cs.

168  {
169  return parameters.Values.Any(x => x.IsUnbounded);
170  }
readonly Dictionary< string, RoutineParameter > parameters
IFunctionConfiguration Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.Named ( ObjectName  name)
inline

Implements Deveel.Data.Sql.Fluid.IFunctionConfiguration.

Definition at line 172 of file FunctionProvider.cs.

172  {
173  if (name == null)
174  throw new ArgumentNullException("name");
175 
176  var parent = name.ParentName;
177 
178  if (!provider.SchemaName.Equals(parent))
179  throw new ArgumentException(String.Format(
180  "The parent name ({0}) is not valid in this provider schema context ({1})", parent, provider.SchemaName));
181 
182  FunctionName = name;
183  return this;
184  }
A long string in the system.
IFunctionConfiguration Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.OfType ( FunctionType  functionType)
inline

Implements Deveel.Data.Sql.Fluid.IFunctionConfiguration.

Definition at line 186 of file FunctionProvider.cs.

186  {
187  FunctionType = functionType;
188  return this;
189  }
IFunctionConfiguration Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.ReturnsType ( Func< InvokeContext, SqlType returns)
inline

Implements Deveel.Data.Sql.Fluid.IFunctionConfiguration.

Definition at line 227 of file FunctionProvider.cs.

227  {
228  ReturnTypeFunc = returns;
229  return this;
230  }
IFunctionConfiguration Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.WhenExecute ( Func< InvokeContext, InvokeResult execute)
inline

Implements Deveel.Data.Sql.Fluid.IFunctionConfiguration.

Definition at line 232 of file FunctionProvider.cs.

232  {
233  ExecuteFunc = execute;
234  return this;
235  }
IFunctionConfiguration Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.WithAlias ( ObjectName  alias)
inline

Implements Deveel.Data.Sql.Fluid.IFunctionConfiguration.

Definition at line 191 of file FunctionProvider.cs.

191  {
192  if (alias == null)
193  throw new ArgumentNullException("alias");
194 
195  if (FunctionName == null)
196  throw new ArgumentException("The function has no name configured and cannot be aliased.");
197 
198  var parent = alias.ParentName;
199 
200  if (!provider.SchemaName.Equals(parent))
201  throw new ArgumentException();
202 
203  if (aliases == null)
204  aliases = new List<ObjectName>();
205 
206  aliases.Add(alias);
207 
208  return this;
209  }
IFunctionConfiguration Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.WithParameter ( Action< IFunctionParameterConfiguration config)
inline

Implements Deveel.Data.Sql.Fluid.IFunctionConfiguration.

Definition at line 211 of file FunctionProvider.cs.

211  {
212  var paramConfig = new FunctionParameterConfiguration(this);
213  if (config != null) {
214  config(paramConfig);
215 
216  var param = paramConfig.AsParameter();
217 
218  if (String.IsNullOrEmpty(param.Name))
219  throw new InvalidOperationException("A parameter must define a name.");
220 
221  parameters.Add(param.Name, param);
222  }
223 
224  return this;
225  }
A long string in the system.
readonly Dictionary< string, RoutineParameter > parameters

Member Data Documentation

List<ObjectName> Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.aliases
private

Definition at line 134 of file FunctionProvider.cs.

readonly Dictionary<string, RoutineParameter> Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.parameters
private

Definition at line 133 of file FunctionProvider.cs.

readonly FunctionProvider Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.provider
private

Definition at line 132 of file FunctionProvider.cs.

Property Documentation

IConfigurationContext Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.Context
get

Definition at line 237 of file FunctionProvider.cs.

Func<InvokeContext, InvokeResult> Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.ExecuteFunc
getprivate set

Definition at line 146 of file FunctionProvider.cs.

FunctionInfo [] Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.FunctionInfo
get

Definition at line 148 of file FunctionProvider.cs.

ObjectName Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.FunctionName
getprivate set

Definition at line 158 of file FunctionProvider.cs.

FunctionType Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.FunctionType
getprivate set

Definition at line 142 of file FunctionProvider.cs.

RoutineParameter [] Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.Parameters
get

Definition at line 160 of file FunctionProvider.cs.

Func<InvokeContext, SqlType> Deveel.Data.Routines.FunctionProvider.FunctionConfiguration.ReturnTypeFunc
getprivate set

Definition at line 144 of file FunctionProvider.cs.


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