Exemplo n.º 1
0
        public Table AddDenormalizedTable(string schema, string catalog, string name, bool isAbstract, string subselect, Table includedTable)
        {
            string key = subselect ?? dialect.Qualify(schema, catalog, name);

            Table table = new DenormalizedTable(includedTable)
            {
                IsAbstract = isAbstract,
                Name       = name,
                Catalog    = catalog,
                Schema     = schema,
                Subselect  = subselect
            };

            Table existing;

            if (tables.TryGetValue(key, out existing))
            {
                if (existing.IsPhysicalTable)
                {
                    throw new DuplicateMappingException("table", name);
                }
            }

            tables[key] = table;
            return(table);
        }
Exemplo n.º 2
0
        public Table AddDenormalizedTable(string schema, string catalog, string name, bool isAbstract, string subselect, Table includedTable)
        {
            string key = subselect ?? BuildTableNameKey(schema, catalog, name);

            Table table = new DenormalizedTable(includedTable)
            {
                IsAbstract = isAbstract,
                Name       = name,
                Catalog    = catalog,
                Schema     = schema,
                Subselect  = subselect
            };

            var tableIndex = tables.Count;

            if (tables.TryGetValue(key, out var existing))
            {
                if (existing.IsPhysicalTable)
                {
                    throw new DuplicateMappingException("table", name);
                }
                tableIndex = existing.UniqueInteger;
            }

            table.UniqueInteger = tableIndex;
            tables[key]         = table;
            return(table);
        }