public void Visit(BeginView beginView)
        {
            var rootGeneric = DataSet.CreateGeneric(beginView.TableName);

            var clarifyGenericMap = new ClarifyGenericMapEntry { ClarifyGeneric = rootGeneric, Model = _modelStack.Peek() };
            _genericStack.Push(clarifyGenericMap);
        }
 public bool Equals(ClarifyGenericMapEntry other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.ClarifyGeneric, ClarifyGeneric) && Equals(other.Model, Model) && Equals(other.NewRoot, NewRoot));
 }
        public void Visit(BeginAdHocRelation beginAdHocRelation)
        {
            validateAdhocRelation(beginAdHocRelation);

            var parentClarifyGenericMap = _genericStack.Peek();

            parentClarifyGenericMap.ClarifyGeneric.DataFields.Add(beginAdHocRelation.FromTableField);

            var tableGeneric = parentClarifyGenericMap.ClarifyGeneric.DataSet.CreateGeneric(beginAdHocRelation.ToTableName);
            tableGeneric.DataFields.Add(beginAdHocRelation.ToTableFieldName);

            var subRootInformation = new SubRootInformation { ParentKeyField = beginAdHocRelation.FromTableField, RootKeyField = beginAdHocRelation.ToTableFieldName };

            var clarifyGenericMap = new ClarifyGenericMapEntry { ClarifyGeneric = tableGeneric, Model = _modelStack.Peek(), NewRoot = subRootInformation };
            parentClarifyGenericMap.AddChildGenericMap(clarifyGenericMap);
            _genericStack.Push(clarifyGenericMap);
        }
 //private IEnumerable<string> verifyFields(string[] fieldNames)
 //{
 //    if (fieldNames == null || !fieldNames.Any())
 //        return new string[0];
 //    var tableName = getCurrentTableName();
 //    return fieldNames.Where(fieldName => fieldName.IsEmpty() || !_schemaCache.IsValidField(tableName, fieldName));
 //}
 public void Visit(EndModelMap endModelMap)
 {
     RootGenericMap = _genericStack.Peek();
 }
        public void Visit(BeginRelation beginRelation)
        {
            var parentClarifyGenericMap = _genericStack.Peek();
            var relationGeneric = parentClarifyGenericMap.ClarifyGeneric.Traverse(beginRelation.RelationName);

            var clarifyGenericMap = new ClarifyGenericMapEntry { ClarifyGeneric = relationGeneric, Model = _modelStack.Peek() };
            parentClarifyGenericMap.AddChildGenericMap(clarifyGenericMap);
            _genericStack.Push(clarifyGenericMap);
        }
 public bool Equals(ClarifyGenericMapEntry other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.ClarifyGeneric, ClarifyGeneric) && Equals(other.Model, Model) && Equals(other.NewRoot, NewRoot);
 }
 public void AddChildGenericMap(ClarifyGenericMapEntry clarifyGenericMap)
 {
     _childMaps.Add(clarifyGenericMap);
 }
 public void AddChildGenericMap(ClarifyGenericMapEntry clarifyGenericMap)
 {
     _childMaps.Add(clarifyGenericMap);
 }