Example #1
0
        }         // func GetClientRelationFromServerRelation

        /// <summary></summary>
        /// <param name="xTable"></param>
        public void WriteSchema(XElement xTable)
        {
            var clientDataType = Meta.GetProperty <string>("clientDataType", null);

            var xColumn = new XElement("column",
                                       new XAttribute("name", Name),
                                       new XAttribute("dataType", clientDataType ?? LuaType.GetType(DataType).AliasOrFullName)
                                       );

            if (IsPrimaryKey)
            {
                xColumn.Add(new XAttribute("isPrimary", IsPrimaryKey));
            }
            if (IsIdentity)
            {
                xColumn.Add(new XAttribute("isIdentity", IsIdentity));
            }

            if (IsRelationColumn)
            {
                xColumn.Add(new XAttribute("parentRelationName", parentRelationName));
                xColumn.Add(new XAttribute("parentRelationType", GetClientRelationFromServerRelation(parentType)));
                xColumn.Add(new XAttribute("parentTable", ParentColumn.Table.Name));
                xColumn.Add(new XAttribute("parentColumn", ParentColumn.Name));
            }
            xTable.Add(xColumn);

            // meta data
            PpsDataSetServerDefinition.WriteSchemaMetaInfo(xColumn, metaInfo);
        }         // proc WriteSchema
Example #2
0
 public PpsDataColumnMetaCollectionServer(PpsDataColumnDefinition column, XElement xColumnDefinition)
     : base(column)
 {
     foreach (var x in xColumnDefinition.Elements(xnMeta))
     {
         PpsDataSetServerDefinition.AddMetaFromElement(x, WellknownMetaTypes, Add);
     }
 }             // ctor
Example #3
0
        }         // proc Merge

        #endregion

        /// <summary></summary>
        /// <param name="xSchema"></param>
        public void WriteSchema(XElement xSchema)
        {
            var xTable = new XElement("table");

            xTable.SetAttributeValue("name", Name);

            // write meta data
            PpsDataSetServerDefinition.WriteSchemaMetaInfo(xTable, metaInfo);

            // write the columns
            foreach (PpsDataColumnServerDefinition column in Columns)
            {
                column.WriteSchema(xTable);
            }

            xSchema.Add(xTable);
        }         // proc WriteSchema
Example #4
0
        }         // ctor

        /// <summary></summary>
        /// <param name="dataset"></param>
        /// <param name="tableName"></param>
        /// <param name="xTable"></param>
        public PpsDataTableServerDefinition(PpsDataSetServerDefinition dataset, string tableName, XElement xTable)
            : base(dataset, tableName)
        {
            foreach (var c in xTable.Elements())
            {
                if (c.Name == xnColumn)
                {
                    AddColumn(PpsDataColumnServerDefinition.Create(this, false, c));
                }
                else if (c.Name == xnRelation)
                {
                    AddColumn(PpsDataColumnServerDefinition.Create(this, true, c));
                }
                else if (c.Name == xnMeta)
                {
                    metaInfo.Add(c);
                }
                //else
                //	throw new InvalidCo
            }
        }         // ctor
Example #5
0
 /// <summary></summary>
 /// <param name="dataset"></param>
 /// <param name="tableName"></param>
 /// <param name="config"></param>
 /// <returns></returns>
 public virtual PpsDataTableServerDefinition CreateTableDefinition(PpsDataSetServerDefinition dataset, string tableName, XElement config)
 => new PpsDataTableServerDefinition(dataset, tableName, config);
Example #6
0
 /// <summary></summary>
 /// <param name="datasetClass"></param>
 public PpsDataSetServer(PpsDataSetServerDefinition datasetClass)
     : base(datasetClass)
 {
 }         // ctor
Example #7
0
 /// <summary></summary>
 /// <param name="dataset"></param>
 /// <param name="clone"></param>
 protected PpsDataTableServerDefinition(PpsDataSetServerDefinition dataset, PpsDataTableServerDefinition clone)
     : base(dataset, clone)
 {
     this.metaInfo = new PpsDataTableMetaCollectionServer(clone.metaInfo);
 }         // ctor
Example #8
0
            }             // ctor

            public void Add(XElement xMeta)
            => PpsDataSetServerDefinition.AddMetaFromElement(xMeta, WellknownMetaTypes, Add);