예제 #1
0
        SQLColumn CreateForeignKey(SQLTable table, string colName, SQLTable fkTable)
        {
            SQLColumn col = CreateColumn(table, colName);

            col.ForeignKey = fkTable.PrimaryKey;
            return(col);
        }
예제 #2
0
        SQLColumn CreateColumn(SQLTable table, string colName)
        {
            SQLColumn col = new SQLColumn(table);

            col.Name = colName;
            return(col);
        }
예제 #3
0
        SQLColumn CreateParentKey(SQLTable table, string colName, SQLTable parentTable)
        {
            SQLColumn col = CreateColumn(table, colName);

            table.ParentKey = col;
            col.ForeignKey  = parentTable.PrimaryKey;
            return(col);
        }
예제 #4
0
        public SQLColumn GetForeignKeyTo(SQLTable table)
        {
            SQLColumn fk = null;

            foreach (var pair in Columns)
            {
                SQLColumn column = pair.Value;
                if (column.ForeignKey != null && column.ForeignKey.Table == table)
                {
                    fk = column;
                    break;
                }
            }
            return(fk);
        }
예제 #5
0
        public SQLColumn FindColumn(string name)
        {
            SQLColumn rv = Columns[name];

            return(rv);
        }