Пример #1
0
 public void addAssociation(TableAssociation ass) {
   String indexKey = null;
   TableNode src = ass.getSource();
   TableNode target = ass.getTarget();
   String index1 = src.getName().split("_")[0];
   String index2 = target.getName().split("_")[0];
   if (index1.equals(index2)) {
     indexKey = index1;
     if (index1.length() > 12) indexKey = index1.substring(0, 11);
   } else {
     indexKey = "MIXED";
   }
   kettleDao.addAssociation(ass, indexKey);
 }
Пример #2
0
 // build a TreeModel base on a table and its columns
 public TreeModel getTableColumnByModel(String module) {
   List<Column> list = kettleDao.getTableColumnByModule(module);
   DefaultMutableTreeNode root = new DefaultMutableTreeNode(module);
   DefaultMutableTreeNode parent = null;
   String previous = null;
   for (Column col : list) {
     // new table, add the table to the root
     if (!col.getTable().equals(previous)) {
       parent = new DefaultMutableTreeNode(col.getTable());
       previous = col.getTable();
       root.add(parent);
     }
     parent.add(new DefaultMutableTreeNode(col));
   }
   return new DefaultTreeModel(root);
 }
Пример #3
0
 public String getSelectClause(String table) {
   StringBuffer sb = new StringBuffer();
   String module = table.split("_")[0];
   List<Column> list = kettleDao.getQueryableColumn(module, table);
   int i = 0;
   for (Column col : list) {
     i++;
     sb.append(col.getColName()).append(" AS ");
     if (col.getLabel().indexOf("\"") > -1) {
       sb.append(col.getLabel());
     } else {
       sb.append("\"").append(col.getLabel()).append("\"");
     }
     if (i < list.size()) {
       sb.append(",").append(token);
     }
   }
   return sb.toString();
 }
Пример #4
0
 public int getTableCountByIndex(String index) {
   return kettleDao.getTableCountByIndex(index);
 }
Пример #5
0
 public void deleteAssociation(TableAssociation ass) {
   kettleDao.deleteTableAssociation(ass);
 }
Пример #6
0
 public int addDiagram(String indexKey, String diagramName) {
   return kettleDao.addDiagram(indexKey, diagramName);
 }
Пример #7
0
 public void updateColumn(List<Column> colList) {
   kettleDao.updateTableColumn(colList);
 }
Пример #8
0
 public void updateAssociations(List<TableAssociation> ass) {
   kettleDao.updateTableAssociation(ass);
 }
Пример #9
0
 public Set<TableAssociation> getTableAssociationsOnly(String tableName) {
   return kettleDao.getTableAssociations(tableName, false);
 }
Пример #10
0
 public List<Column> getTableColumns(String tableName) {
   List<Column> list = kettleDao.getTableColumnByTable(tableName);
   return list;
 }
Пример #11
0
 public List<Diagram> getDiagramByIndex(String index) {
   return kettleDao.getDiagramListByIndex(index);
 }
Пример #12
0
 public Set<TableAssociation> getTableAssociations(String tableName) {
   return kettleDao.getTableAssociations(tableName, true);
 }
Пример #13
0
 public List<String> getTablesByModule(String module) {
   return kettleDao.getTablesByModule(module);
 }
Пример #14
0
 public List<String> getAllModules() {
   return kettleDao.getAllModules();
 }
Пример #15
0
 public int updateDiagram(Long id, String text) {
   return kettleDao.updateDigram(id, text);
 }
Пример #16
0
 public String getDiagramScript(Long id) {
   return kettleDao.getDiagramScript(id);
 }
Пример #17
0
 public int deleteDiagram(Diagram diagram) {
   return kettleDao.deleteDiagram(diagram.getId());
 }