public static WhereClauseEditorUi createEditorUi(TransformationDatabaseInfo info) {
// XXX: We currently do not store table and column information in the
// DatabaseStructure class, so we need to send in the db objects
// separately. This will change with the upcoming new structure
// implementation.
DatabaseStructure structure = info.getStructure();
DatabaseObject[] objects = info.getDatabaseObjects();
switch (objects.length) {
case 0:
return null;
case 1:
SqlScript existingScript = structure.getSqlScript();
String existingWhereClause = (existingScript == null) ? "" :
existingScript.getWhereClause();
BeginEndQuote quotes = structure.getBeginEndQuote();
return new SingleTableEditorUi(objects[0], existingWhereClause, quotes);
default:
DbTranFilters filters = structure.getHierarchicalFilters();
return new MultipleTableEditorUi(objects, filters);
}
}