DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Classes | Static Public Member Functions | Properties | Static Private Member Functions | List of all members
Deveel.Data.Sql.Expressions.SqlExpressionSerializers Class Reference

Classes

class  SqlAssignExpressionSerializer
 
class  SqlBinaryExpressionSerializer
 
class  SqlConditionalExpressionSerializer
 
class  SqlConstantExpressionSerializer
 
class  SqlExpressionSerializer
 
class  SqlExpressionSerializerResolver
 
class  SqlFunctionCallExpressionSerializer
 
class  SqlQueryExpressionSerializer
 
class  SqlReferenceExpressionSerializer
 
class  SqlTupleExpressionSerializer
 
class  SqlUnaryExpressionSerializer
 
class  SqlVariableReferenceExpressionSerializer
 

Static Public Member Functions

static void Serialize (SqlExpression expression, BinaryWriter writer)
 
static SqlExpression Deserialize (BinaryReader reader)
 

Properties

static IObjectSerializerResolver Resolver [get, private set]
 

Static Private Member Functions

static SqlExpressionSerializers ()
 

Detailed Description

Definition at line 25 of file SqlExpressionSerializers.cs.

Constructor & Destructor Documentation

static Deveel.Data.Sql.Expressions.SqlExpressionSerializers.SqlExpressionSerializers ( )
inlinestaticprivate

Definition at line 26 of file SqlExpressionSerializers.cs.

26  {
27  Resolver = new SqlExpressionSerializerResolver();
28  }

Member Function Documentation

static SqlExpression Deveel.Data.Sql.Expressions.SqlExpressionSerializers.Deserialize ( BinaryReader  reader)
inlinestatic

Definition at line 51 of file SqlExpressionSerializers.cs.

51  {
52  var status = reader.ReadByte();
53  if (status == 0)
54  return null;
55 
56  var typeName = reader.ReadString();
57 #if PCL
58  var type = Type.GetType(typeName, true);
59 #else
60  var type = Type.GetType(typeName, true, true);
61 #endif
62 
63  var serializer = Resolver.ResolveSerializer(type) as IObjectBinarySerializer;
64  if (serializer == null)
65  throw new InvalidOperationException(String.Format("Cannot find a valid binary serializer for expression of type '{0}'", type));
66 
67  return (SqlExpression) serializer.Deserialize(reader);
68  }
A long string in the system.
A user-defined TYPE that holds complex objects in a database column.
IObjectSerializer ResolveSerializer(Type objectType)
static void Deveel.Data.Sql.Expressions.SqlExpressionSerializers.Serialize ( SqlExpression  expression,
BinaryWriter  writer 
)
inlinestatic

Definition at line 32 of file SqlExpressionSerializers.cs.

32  {
33  if (expression == null) {
34  writer.Write((byte)0);
35  return;
36  }
37 
38  var expType = expression.GetType();
39  var expTypeName = expType.FullName;
40 
41  var serializer = Resolver.ResolveSerializer(expType) as IObjectBinarySerializer;
42  if (serializer == null)
43  throw new InvalidOperationException(String.Format("Cannot find a valid binary serializer for expression of type '{0}'", expType));
44 
45  writer.Write((byte)1);
46  writer.Write(expTypeName);
47 
48  serializer.Serialize(expression, writer);
49  }
A long string in the system.
IObjectSerializer ResolveSerializer(Type objectType)
void Serialize(object obj, BinaryWriter writer)

Property Documentation

IObjectSerializerResolver Deveel.Data.Sql.Expressions.SqlExpressionSerializers.Resolver
staticgetprivate set

Definition at line 30 of file SqlExpressionSerializers.cs.


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