Ejemplo n.º 1
0
        private static ICollection<string> BuildColumnIndex(TableRuleConfig rule)
        {
            if (rule == null)
                return new HashSet<string>();

            var rs = rule.Rules;
            if (rs == null || rs.Length <= 0)
                return new HashSet<string>();

            ICollection<string> columnIndex = new HashSet<string>();
            foreach (var r in rs)
            {
                var columns = r.Columns;
                if (columns != null)
                {
                    foreach (var col in columns)
                    {
                        if (col != null)
                        {
                            columnIndex.Add(col.ToUpper());
                        }
                    }
                }
            }
            return columnIndex;
        }
Ejemplo n.º 2
0
        private static ICollection <string> BuildColumnIndex(TableRuleConfig rule)
        {
            if (rule == null)
            {
                return(new HashSet <string>());
            }

            var rs = rule.Rules;

            if (rs == null || rs.Length <= 0)
            {
                return(new HashSet <string>());
            }

            ICollection <string> columnIndex = new HashSet <string>();

            foreach (var r in rs)
            {
                var columns = r.Columns;
                if (columns != null)
                {
                    foreach (var col in columns)
                    {
                        if (col != null)
                        {
                            columnIndex.Add(col.ToUpper());
                        }
                    }
                }
            }
            return(columnIndex);
        }
Ejemplo n.º 3
0
 public TableConfig(string name, string dataNode, TableRuleConfig rule, bool ruleRequired)
 {
     Name = name;
     DataNodes = SplitUtil.Split(dataNode, ',', '$', '-', '[', ']');
     if (DataNodes == null || DataNodes.Length <= 0)
     {
         throw new ArgumentException("invalid table _dataNodes: " + dataNode);
     }
     Rule = rule;
     _columnIndex = BuildColumnIndex(rule);
     IsRuleRequired = ruleRequired;
 }
Ejemplo n.º 4
0
 public TableConfig(string name, string dataNode, TableRuleConfig rule, bool ruleRequired)
 {
     Name      = name;
     DataNodes = SplitUtil.Split(dataNode, ',', '$', '-', '[', ']');
     if (DataNodes == null || DataNodes.Length <= 0)
     {
         throw new ArgumentException("invalid table _dataNodes: " + dataNode);
     }
     Rule           = rule;
     _columnIndex   = BuildColumnIndex(rule);
     IsRuleRequired = ruleRequired;
 }