Example #1
0
        public void AddJoins(TableKey source, TableKey destination)
        {
            if (source == destination)
            {
                return;
            }

            DbJoin join = new DbJoin(source, destination);

            CreateJoin(join);
        }
Example #2
0
        private void CreateJoin(DbJoin arg)
        {
            TableKey childTable = arg.Source;
            TableKey parent     = null;

            while ((parent = childTable.Parent) != null && (arg.Destination != childTable))
            {
                DbJoin join = new DbJoin(childTable, parent);

                if (!_generatedJoins.ContainsKey(join))
                {
                    var joins = _cachedJoins.GetOrAdd(join, GenerateAndAddNewJoin);
                    _generatedJoins.Add(join, joins.First( ));
                }

                childTable = parent;
            }
        }
Example #3
0
        private List <string> GenerateAndAddNewJoin(DbJoin arg)
        {
            string joinText = GetJoinWithParent(arg.Source);

            return(new List <string> (new string[] { joinText }));
        }