DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
SqlBinaryExpression.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 
21 namespace Deveel.Data.Sql.Expressions {
22  [Serializable]
23  public sealed class SqlBinaryExpression : SqlExpression {
25 
26  internal SqlBinaryExpression(SqlExpression left, SqlExpressionType expressionType, SqlExpression right) {
27  if (left == null)
28  throw new ArgumentNullException("left");
29  if (right == null)
30  throw new ArgumentNullException("right");
31 
32  this.expressionType = expressionType;
33 
34  Left = left;
35  Right = right;
36  }
37 
39  : base(data) {
40  Left = data.GetValue<SqlExpression>("Left");
41  Right = data.GetValue<SqlExpression>("Right");
42  expressionType = (SqlExpressionType) data.GetInt32("ExpressionType");
43  }
44 
45  public SqlExpression Left { get; private set; }
46 
47  public SqlExpression Right { get; private set; }
48 
49  public override bool CanEvaluate {
50  get { return true; }
51  }
52 
53  public override SqlExpressionType ExpressionType {
54  get { return expressionType; }
55  }
56 
57  protected override void GetData(SerializeData data) {
58  data.SetValue("Left", Left);
59  data.SetValue("Right", Right);
60  data.SetValue("ExpressionType", (int)expressionType);
61  }
62  }
63 }
void SetValue(string key, Type type, object value)
SqlExpressionType
All the possible type of SqlExpression supported
Returns all the records in the left side of the join, even if the other side has no corresponding rec...
Returns all the records in the right side of the join, even if the other side has no corresponding re...
SqlBinaryExpression(SqlExpression left, SqlExpressionType expressionType, SqlExpression right)
Defines the base class for instances that represent SQL expression tree nodes.