Example #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);
 }
Example #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);
 }
Example #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();
 }
Example #4
0
 public int getTableCountByIndex(String index) {
   return kettleDao.getTableCountByIndex(index);
 }
Example #5
0
 public void deleteAssociation(TableAssociation ass) {
   kettleDao.deleteTableAssociation(ass);
 }
Example #6
0
 public int addDiagram(String indexKey, String diagramName) {
   return kettleDao.addDiagram(indexKey, diagramName);
 }
Example #7
0
 public void updateColumn(List<Column> colList) {
   kettleDao.updateTableColumn(colList);
 }
Example #8
0
 public void updateAssociations(List<TableAssociation> ass) {
   kettleDao.updateTableAssociation(ass);
 }
Example #9
0
 public Set<TableAssociation> getTableAssociationsOnly(String tableName) {
   return kettleDao.getTableAssociations(tableName, false);
 }
Example #10
0
 public List<Column> getTableColumns(String tableName) {
   List<Column> list = kettleDao.getTableColumnByTable(tableName);
   return list;
 }
Example #11
0
 public List<Diagram> getDiagramByIndex(String index) {
   return kettleDao.getDiagramListByIndex(index);
 }
Example #12
0
 public Set<TableAssociation> getTableAssociations(String tableName) {
   return kettleDao.getTableAssociations(tableName, true);
 }
Example #13
0
 public List<String> getTablesByModule(String module) {
   return kettleDao.getTablesByModule(module);
 }
Example #14
0
 public List<String> getAllModules() {
   return kettleDao.getAllModules();
 }
Example #15
0
 public int updateDiagram(Long id, String text) {
   return kettleDao.updateDigram(id, text);
 }
Example #16
0
 public String getDiagramScript(Long id) {
   return kettleDao.getDiagramScript(id);
 }
Example #17
0
 public int deleteDiagram(Diagram diagram) {
   return kettleDao.deleteDiagram(diagram.getId());
 }