DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
SqlQueryObject.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.Sql.Query;
21 
22 namespace Deveel.Data.Sql.Objects {
23  [Serializable]
24  public sealed class SqlQueryObject : ISqlObject, ISerializable {
25  public static readonly SqlQueryObject Null = new SqlQueryObject((IQueryPlanNode) null);
26 
27  public SqlQueryObject(IQueryPlanNode queryPlan) {
28  QueryPlan = queryPlan;
29  }
30 
31  private SqlQueryObject(ObjectData data) {
32  QueryPlan = data.GetValue<IQueryPlanNode>("QueryPlan");
33  }
34 
35  public IQueryPlanNode QueryPlan { get; private set; }
36 
37  int IComparable.CompareTo(object obj) {
38  throw new NotSupportedException("SQL queries cannot be compared.");
39  }
40 
41  int IComparable<ISqlObject>.CompareTo(ISqlObject other) {
42  throw new NotSupportedException("SQL queries cannot be compared.");
43  }
44 
45  public bool IsNull {
46  get { return QueryPlan == null; }
47  }
48 
50  return false;
51  }
52 
54  data.SetValue("QueryPlan", QueryPlan);
55  }
56  }
57 }
void GetData(SerializeData data)
void SetValue(string key, Type type, object value)
A node element of a query plan tree. /summary>
Defines the contract for a valid SQL Object
Definition: ISqlObject.cs:23
bool IsComparableTo(ISqlObject other)
Checks if the current object is comparable with the given one.
SqlQueryObject(IQueryPlanNode queryPlan)