private SqlTableConstraint(ObjectData data)
 {
     ConstraintName = data.GetString("Name");
     ConstraintType = (ConstraintType) data.GetInt32("Type");
     Columns = data.GetValue<string[]>("Columns");
     CheckExpression = data.GetValue<SqlExpression>("Check");
     ReferenceTable = data.GetString("ReferenceTable");
     ReferenceColumns = data.GetValue<string[]>("ReferenceColumns");
     OnDelete = (ForeignKeyAction) data.GetInt32("OnDelete");
     OnUpdate = (ForeignKeyAction) data.GetInt32("OnUpdate");
 }
Example #2
0
 private SqlTableConstraint(ObjectData data)
 {
     ConstraintName   = data.GetString("Name");
     ConstraintType   = (ConstraintType)data.GetInt32("Type");
     Columns          = data.GetValue <string[]>("Columns");
     CheckExpression  = data.GetValue <SqlExpression>("Check");
     ReferenceTable   = data.GetString("ReferenceTable");
     ReferenceColumns = data.GetValue <string[]>("ReferenceColumns");
     OnDelete         = (ForeignKeyAction)data.GetInt32("OnDelete");
     OnUpdate         = (ForeignKeyAction)data.GetInt32("OnUpdate");
 }
Example #3
0
 private QueryParameter(ObjectData data)
 {
     Name = data.GetString("Name");
     SqlType = data.GetValue<SqlType>("Type");
     Value = data.GetValue<Objects.ISqlObject>("Value");
     Direction = (QueryParameterDirection) data.GetInt32("Direction");
 }
 private SimpleSelectNode(ObjectData data)
     : base(data)
 {
     ColumnName = data.GetValue<ObjectName>("Column");
     OperatorType = (SqlExpressionType) data.GetInt32("Operator");
     Expression = data.GetValue<SqlExpression>("Expression");
 }
Example #5
0
 private SimpleSelectNode(ObjectData data)
     : base(data)
 {
     ColumnName   = data.GetValue <ObjectName>("Column");
     OperatorType = (SqlExpressionType)data.GetInt32("Operator");
     Expression   = data.GetValue <SqlExpression>("Expression");
 }
Example #6
0
 private JoinNode(ObjectData data)
     : base(data)
 {
     LeftColumnName = data.GetValue<ObjectName>("LeftColumn");
     Operator = (SqlExpressionType) data.GetInt32("Operator");
     RightExpression = data.GetValue<SqlExpression>("RightExpression");
 }
Example #7
0
 private JoinPart(ObjectData data)
 {
     TableName = data.GetValue<ObjectName>("Table");
     SubQuery = data.GetValue<SqlQueryExpression>("SubQuery");
     JoinType = (JoinType) data.GetInt32("JoinType");
     OnExpression = data.GetValue<SqlExpression>("On");
 }
Example #8
0
 private Prepared(ObjectData data)
 {
     Grantee     = data.GetString("Grantee");
     Privileges  = (Privileges)data.GetInt32("Privileges");
     ObjectName  = data.GetValue <ObjectName>("ObjectName");
     GrantOption = data.GetBoolean("GrantOption");
 }
Example #9
0
 private JoinNode(ObjectData data)
     : base(data)
 {
     LeftColumnName  = data.GetValue <ObjectName>("LeftColumn");
     Operator        = (SqlExpressionType)data.GetInt32("Operator");
     RightExpression = data.GetValue <SqlExpression>("RightExpression");
 }
Example #10
0
 private Prepared(ObjectData data)
 {
     TableName = data.GetValue <ObjectName>("TableName");
     QueryPlan = data.GetValue <IQueryPlanNode>("QueryPlan");
     Columns   = data.GetValue <SqlAssignExpression[]>("Columns");
     Limit     = data.GetInt32("Limit");
 }
Example #11
0
 private SqlBinaryExpression(ObjectData data)
     : base(data)
 {
     Left           = data.GetValue <SqlExpression>("Left");
     Right          = data.GetValue <SqlExpression>("Right");
     expressionType = (SqlExpressionType)data.GetInt32("ExpressionType");
 }
Example #12
0
        private SqlNumber(ObjectData data)
            : this()
        {
            var state = (NumericState)data.GetByte("State");

            if (state == NumericState.None)
            {
                var bytes     = data.GetValue <byte[]>("Bytes");
                var scale     = data.GetInt32("Scale");
                var precision = data.GetInt32("Precision");

                innerValue = new BigDecimal(new BigInteger(bytes), scale, new MathContext(precision));
            }

            State = state;
        }
Example #13
0
 private JoinPart(ObjectData data)
 {
     TableName    = data.GetValue <ObjectName>("Table");
     SubQuery     = data.GetValue <SqlQueryExpression>("SubQuery");
     JoinType     = (JoinType)data.GetInt32("JoinType");
     OnExpression = data.GetValue <SqlExpression>("On");
 }
 private SqlBinaryExpression(ObjectData data)
     : base(data)
 {
     Left = data.GetValue<SqlExpression>("Left");
     Right = data.GetValue<SqlExpression>("Right");
     expressionType = (SqlExpressionType) data.GetInt32("ExpressionType");
 }
Example #15
0
 private QueryParameter(ObjectData data)
 {
     Name      = data.GetString("Name");
     SqlType   = data.GetValue <SqlType>("Type");
     Value     = data.GetValue <Objects.ISqlObject>("Value");
     Direction = (QueryParameterDirection)data.GetInt32("Direction");
 }
 private GrantPrivilegesStatement(ObjectData data)
 {
     ObjectName = data.GetValue<ObjectName>("ObjectName");
     Grantee = data.GetString("Grantee");
     Privilege = (Privileges) data.GetInt32("Privilege");
     Columns = data.GetValue<string[]>("Columns");
     WithGrant = data.GetBoolean("WithGrant");
 }
 private GrantPrivilegesStatement(ObjectData data)
 {
     ObjectName = data.GetValue <ObjectName>("ObjectName");
     Grantee    = data.GetString("Grantee");
     Privilege  = (Privileges)data.GetInt32("Privilege");
     Columns    = data.GetValue <string[]>("Columns");
     WithGrant  = data.GetBoolean("WithGrant");
 }
        private DeclareCursorStatement(ObjectData data)
        {
            CursorName = data.GetString("CursorName");
            QueryExpression = data.GetValue<SqlQueryExpression>("QueryExpression");
            Flags = (CursorFlags) data.GetInt32("Flags");

            if (data.HasValue("Parameters")) {
                var parameters = data.GetValue<CursorParameter[]>("Parameters");
                Parameters = new List<CursorParameter>(parameters);
            }
        }
Example #19
0
        private DeclareCursorStatement(ObjectData data)
        {
            CursorName      = data.GetString("CursorName");
            QueryExpression = data.GetValue <SqlQueryExpression>("QueryExpression");
            Flags           = (CursorFlags)data.GetInt32("Flags");

            if (data.HasValue("Parameters"))
            {
                var parameters = data.GetValue <CursorParameter[]>("Parameters");
                Parameters = new List <CursorParameter>(parameters);
            }
        }
Example #20
0
            private Prepared(ObjectData data)
            {
                TableName = data.GetValue <ObjectName>("TableName");
                int setCount     = data.GetInt32("SetCount");
                var assignmenets = new SqlAssignExpression[setCount][];

                for (int i = 0; i < setCount; i++)
                {
                    assignmenets[i] = data.GetValue <SqlAssignExpression[]>(String.Format("Assign[{0}]", i));
                }

                Assignments = assignmenets;
            }
Example #21
0
        private StringType(ObjectData data)
            : base(data)
        {
            MaxSize = data.GetInt32("MaxSize");

            if (data.HasValue("Locale")) {
                var locale = data.GetString("Locale");
                Locale = new CultureInfo(locale);
            }

            if (data.HasValue("Encoding")) {
                var encoding = data.GetString("Encoding");
                Encoding = Encoding.GetEncoding(encoding);
            }
        }
Example #22
0
        private StringType(ObjectData data)
            : base(data)
        {
            MaxSize = data.GetInt32("MaxSize");

            if (data.HasValue("Locale"))
            {
                var locale = data.GetString("Locale");
                Locale = new CultureInfo(locale);
            }

            if (data.HasValue("Encoding"))
            {
                var encoding = data.GetString("Encoding");
                Encoding = Encoding.GetEncoding(encoding);
            }
        }
Example #23
0
        private SqlQuery(ObjectData data)
        {
            Text           = data.GetString("Text");
            ParameterStyle = (QueryParameterStyle)data.GetInt32("ParameterStyle");

            Parameters = new QueryParameterCollection(this);

            var parameters = data.GetValue <QueryParameter[]>("Parameters");

            if (parameters != null)
            {
                foreach (var parameter in parameters)
                {
                    Parameters.Add(parameter);
                }
            }
        }
        private SqlQueryExpression(ObjectData data)
        {
            if (data.HasValue("Columns"))
                SelectColumns = data.GetValue<SelectColumn[]>("Columns");

            Distinct = data.GetBoolean("Distinct");
            FromClause = data.GetValue<FromClause>("From");
            WhereExpression = data.GetValue<SqlExpression>("Where");
            HavingExpression = data.GetValue<SqlExpression>("Having");
            GroupBy = data.GetValue<SqlExpression[]>("GroupBy");
            GroupMax = data.GetValue<ObjectName>("GroupMax");
            NextComposite = data.GetValue<SqlQueryExpression>("NextComposite");

            if (data.HasValue("CompositeFunction"))
                CompositeFunction = (CompositeFunction) data.GetInt32("CompositeFunction");

            IsCompositeAll = data.GetBoolean("CompositeAll");
        }
Example #25
0
        private TableInfo(ObjectData data)
        {
            TableName   = data.GetValue <ObjectName>("TableName");
            Id          = data.GetInt32("TableId");
            IsPermanent = data.GetBoolean("Permanent");
            IsReadOnly  = data.GetBoolean("ReaDOnly");

            columns = new List <ColumnInfo>();
            var columnInfo = data.GetValue <ColumnInfo[]>("Columns");

            if (columnInfo != null)
            {
                foreach (var info in columnInfo)
                {
                    info.TableInfo = this;
                    columns.Add(info);
                }
            }

            columnsCache = new Dictionary <ObjectName, int>();
        }
Example #26
0
        private SqlQueryExpression(ObjectData data)
        {
            if (data.HasValue("Columns"))
            {
                SelectColumns = data.GetValue <SelectColumn[]>("Columns");
            }

            Distinct         = data.GetBoolean("Distinct");
            FromClause       = data.GetValue <FromClause>("From");
            WhereExpression  = data.GetValue <SqlExpression>("Where");
            HavingExpression = data.GetValue <SqlExpression>("Having");
            GroupBy          = data.GetValue <SqlExpression[]>("GroupBy");
            GroupMax         = data.GetValue <ObjectName>("GroupMax");
            NextComposite    = data.GetValue <SqlQueryExpression>("NextComposite");

            if (data.HasValue("CompositeFunction"))
            {
                CompositeFunction = (CompositeFunction)data.GetInt32("CompositeFunction");
            }

            IsCompositeAll = data.GetBoolean("CompositeAll");
        }
Example #27
0
 private SqlUnaryExpression(ObjectData data)
     : base(data)
 {
     Operand        = data.GetValue <SqlExpression>("Operand");
     expressionType = (SqlExpressionType)data.GetInt32("Operator");
 }
Example #28
0
 private NumericType(ObjectData data)
     : base(data)
 {
     Size = data.GetInt32("Size");
     Scale = data.GetByte("Scale");
 }
Example #29
0
 private LoopControlStatement(ObjectData data)
 {
     Label          = data.GetString("ControlType");
     ControlType    = (LoopControlType)data.GetInt32("ControlType");
     WhenExpression = data.GetValue <SqlExpression>("WhenExpression");
 }
Example #30
0
            private Prepared(ObjectData data)
            {
                TableName = data.GetValue<ObjectName>("TableName");
                int setCount = data.GetInt32("SetCount");
                var assignmenets = new SqlAssignExpression[setCount][];
                for (int i = 0; i < setCount; i++) {
                    assignmenets[i] = data.GetValue<SqlAssignExpression[]>(String.Format("Assign[{0}]", i));
                }

                Assignments = assignmenets;
            }
Example #31
0
 private Prepared(ObjectData data)
 {
     TableName = data.GetValue<ObjectName>("TableName");
     QueryPlan = data.GetValue<IQueryPlanNode>("QueryPlan");
     Columns = data.GetValue<SqlAssignExpression[]>("Columns");
     Limit = data.GetInt32("Limit");
 }
Example #32
0
 private CachePointNode(ObjectData data)
     : base(data)
 {
     Id = data.GetInt32("Id");
 }
Example #33
0
 protected SqlType(ObjectData data)
 {
     Name     = data.GetString("Name");
     TypeCode = (SqlTypeCode)data.GetInt32("TypeCode");
 }
Example #34
0
 private BinaryType(ObjectData data)
     : base(data)
 {
     MaxSize = data.GetInt32("MaxSize");
 }
 private LoopControlStatement(ObjectData data)
 {
     Label = data.GetString("ControlType");
     ControlType = (LoopControlType) data.GetInt32("ControlType");
     WhenExpression = data.GetValue<SqlExpression>("WhenExpression");
 }
Example #36
0
 private CachePointNode(ObjectData data)
     : base(data)
 {
     Id = data.GetInt32("Id");
 }
 private SqlUnaryExpression(ObjectData data)
     : base(data)
 {
     Operand = data.GetValue<SqlExpression>("Operand");
     expressionType = (SqlExpressionType) data.GetInt32("Operator");
 }
 private NonCorrelatedAnyAllNode(ObjectData data)
     : base(data)
 {
     LeftColumnNames = data.GetValue<ObjectName[]>("LeftColumns");
     SubQueryType = (SqlExpressionType) data.GetInt32("SubQueryType");
 }
 private SetAccountStatusAction(ObjectData data)
 {
     Status = (UserStatus) data.GetInt32("Status");
 }
 private Prepared(ObjectData data)
 {
     Grantee = data.GetString("Grantee");
     Privileges = (Privileges) data.GetInt32("Privileges");
     ObjectName = data.GetValue<ObjectName>("ObjectName");
     GrantOption = data.GetBoolean("GrantOption");
 }
Example #41
0
 private CompositeNode(ObjectData data)
     : base(data)
 {
     CompositeFunction = (CompositeFunction)data.GetInt32("Function");
     All = data.GetBoolean("All");
 }
Example #42
0
 private NonCorrelatedAnyAllNode(ObjectData data)
     : base(data)
 {
     LeftColumnNames = data.GetValue <ObjectName[]>("LeftColumns");
     SubQueryType    = (SqlExpressionType)data.GetInt32("SubQueryType");
 }
Example #43
0
 private NumericType(ObjectData data)
     : base(data)
 {
     Size  = data.GetInt32("Size");
     Scale = data.GetByte("Scale");
 }
Example #44
0
 private Prepared(ObjectData data)
 {
     TableName = data.GetValue <ObjectName>("TableName");
     Target    = (ShowTarget)data.GetInt32("Target");
 }
Example #45
0
 private SetAccountStatusAction(ObjectData data)
 {
     Status = (UserStatus)data.GetInt32("Status");
 }
Example #46
0
 private BinaryType(ObjectData data)
     : base(data)
 {
     MaxSize = data.GetInt32("MaxSize");
 }