예제 #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());
 }