public static ResultColumn createResultColumn(QueryTable queryTableModel, TResultColumn resultColumn) { if (ModelBindingManager.getModel(resultColumn) is ResultColumn) { return((ResultColumn)ModelBindingManager.getModel(resultColumn)); } ResultColumn column = new ResultColumn(queryTableModel, resultColumn); ModelBindingManager.bindModel(resultColumn, column); return(column); }
public static QueryTable createQueryTable(TTable table) { QueryTable tableModel = null; if (table.CTE != null) { if (ModelBindingManager.getModel(table.CTE) is QueryTable) { return((QueryTable)ModelBindingManager.getModel(table.CTE)); } tableModel = new QueryTable(table); ModelBindingManager.bindModel(table.CTE, tableModel); } else if (table.Subquery != null && table.Subquery.ResultColumnList != null) { if (ModelBindingManager.getModel(table.Subquery.ResultColumnList) is QueryTable) { return((QueryTable)ModelBindingManager.getModel(table.Subquery.ResultColumnList)); } tableModel = new QueryTable(table); ModelBindingManager.bindModel(table.Subquery.ResultColumnList, tableModel); } else { if (ModelBindingManager.getModel(table) is QueryTable) { return((QueryTable)ModelBindingManager.getModel(table)); } tableModel = new QueryTable(table); ModelBindingManager.bindModel(table, tableModel); } return(tableModel); }