Пример #1
0
        public FromTable Prepare(IExpressionPreparer preparer)
        {
            var fromTable = new FromTable {
                Name  = Name,
                Alias =
                    Alias,
                UniqueKey       = UniqueKey,
                IsSubQueryTable = IsSubQueryTable
            };

            if (SubSelect != null)
            {
                fromTable.SubSelect = SubSelect.Prepare(preparer);
            }

            return(fromTable);
        }
Пример #2
0
        private void AddFromTable(ObjectName tableName, FromTable table)
        {
            if (tableName != null)
            {
                if (allTableNames.Contains(tableName))
                {
                    throw new ApplicationException("Duplicate table name in FROM clause: " + tableName);
                }

                allTableNames.Add(tableName);
            }

            // Create a new unique key for this table
            string key = CreateNewKey();

            table.UniqueKey = key;
            // Add the table key to the join set
            JoinSet.AddTable(key);
            // Add to the alias def map
            fromTableList.Add(table);
        }