use of com.kyj.fx.voeditor.visual.main.model.vo.TbmSysDaoMethodsHDVO in project Gargoyle by callakrsos.
the class DAOLoaderController method listHistoryItems.
private List<TbmSysDaoMethodsHDVO> listHistoryItems(Map<String, Object> paramMap) throws Exception {
StringBuffer sb = new StringBuffer();
sb.append("select b.hist_tsp, b.package_name, b.class_name, b.method_name, b.result_vo_class, b.dml_type, fst_reg_dt from \n");
if (DbUtil.isExistsSchemaDatabase())
sb.append("meerkat.tbm_sys_dao a inner join meerkat.tbp_sys_dao_methods_h b\n");
else
sb.append("tbm_sys_dao a inner join tbp_sys_dao_methods_h b\n");
sb.append("on a.package_name = b.package_name and a.class_name = b.class_name\n");
sb.append("and a.package_name = :packageName \n");
sb.append("and a.class_name =:className\n");
sb.append("order by fst_reg_dt desc\n");
return DbUtil.select(sb.toString(), paramMap, (rs, row) -> {
TbmSysDaoMethodsHDVO tbmSysDaoMethodsHDVO = new TbmSysDaoMethodsHDVO();
tbmSysDaoMethodsHDVO.setHistTsp(rs.getString("HIST_TSP"));
tbmSysDaoMethodsHDVO.setPackageName(rs.getString("PACKAGE_NAME"));
tbmSysDaoMethodsHDVO.setClassName(rs.getString("CLASS_NAME"));
tbmSysDaoMethodsHDVO.setMethodName(rs.getString("METHOD_NAME"));
tbmSysDaoMethodsHDVO.setResultVoClass(rs.getString("RESULT_VO_CLASS"));
tbmSysDaoMethodsHDVO.setDmlType(rs.getString("DML_TYPE"));
tbmSysDaoMethodsHDVO.setFstRegDt(rs.getString("FST_REG_DT"));
return tbmSysDaoMethodsHDVO;
});
}
use of com.kyj.fx.voeditor.visual.main.model.vo.TbmSysDaoMethodsHDVO in project Gargoyle by callakrsos.
the class DAOLoaderController method getHistorySQL.
private TbmSysDaoMethodsHDVO getHistorySQL(Map<String, Object> paramMap) throws Exception {
StringBuffer sb = new StringBuffer();
if (DbUtil.isExistsSchemaDatabase())
sb.append("select hist_tsp, sql_body from meerkat.tbp_sys_dao_methods_h ");
else
sb.append("select hist_tsp, sql_body from tbp_sys_dao_methods_h ");
sb.append("where hist_tsp =:histTsp");
List<TbmSysDaoMethodsHDVO> select = DbUtil.select(sb.toString(), paramMap, (rs, row) -> {
TbmSysDaoMethodsHDVO tbmSysDaoMethodsHDVO = new TbmSysDaoMethodsHDVO();
tbmSysDaoMethodsHDVO.setHistTsp(rs.getString("HIST_TSP"));
tbmSysDaoMethodsHDVO.setSqlBody(rs.getString("SQL_BODY"));
return tbmSysDaoMethodsHDVO;
});
if (select.isEmpty())
return null;
return select.get(0);
}
use of com.kyj.fx.voeditor.visual.main.model.vo.TbmSysDaoMethodsHDVO in project Gargoyle by callakrsos.
the class DAOLoaderController method menuHistoryOnAction.
/**
* 히스토리 이력을 살펴보는경우 사용
*
* @작성자 : KYJ
* @작성일 : 2015. 11. 6.
* @param event
*/
public void menuHistoryOnAction(ActionEvent event) {
Map<String, Object> selectedItem = tbSrchDao.getSelectionModel().getSelectedItem();
if (selectedItem == null)
return;
String packageName = ValueUtil.emptyThan(selectedItem.get("PACKAGE_NAME"), "").toString();
String className = ValueUtil.emptyThan(selectedItem.get("CLASS_NAME"), "").toString();
// Stage primaryStage = SharedMemory.getPrimaryStage();
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("packageName", packageName);
paramMap.put("className", className);
try {
List<TbmSysDaoMethodsHDVO> select = listHistoryItems(paramMap);
CommonsBaseGridView<TbmSysDaoMethodsHDVO> commonsBaseGridView = new CommonsBaseGridView<>(TbmSysDaoMethodsHDVO.class, select);
TableViewSelectionModel<TbmSysDaoMethodsHDVO> selectionModel = commonsBaseGridView.getSelectionModel();
selectionModel.setSelectionMode(SelectionMode.MULTIPLE);
BorderPane borderPane = new BorderPane();
Label value = new Label("History");
value.setStyle("-fx-font-size:75px");
borderPane.setTop(value);
SqlKeywords sqlKeyword = new SqlKeywords();
borderPane.setBottom(sqlKeyword);
SplitPane splitPane = new SplitPane(commonsBaseGridView, sqlKeyword);
splitPane.setOrientation(Orientation.VERTICAL);
borderPane.setCenter(splitPane);
commonsBaseGridView.setOnMouseClicked(ev -> {
if (ev.getClickCount() == 2) {
try {
TbmSysDaoMethodsHDVO selectedItem2 = commonsBaseGridView.getSelectionModel().getSelectedItem();
String histTsp = selectedItem2.getHistTsp();
String sqlBody = getSqlBody(histTsp);
sqlKeyword.setContent(sqlBody);
} catch (Exception e) {
LOGGER.error(ValueUtil.toString(e));
}
}
});
MenuItem compare = new MenuItem("Compare.");
compare.setDisable(true);
compare.setOnAction(ev -> {
ObservableList<TbmSysDaoMethodsHDVO> selectedItems = commonsBaseGridView.getSelectionModel().getSelectedItems();
if (selectedItems.size() == 2) {
compare(selectedItems.get(0), selectedItems.get(1));
}
});
ContextMenu historyContextMenu = new ContextMenu(compare);
historyContextMenu.setOnShowing(ev -> {
if (selectionModel.getSelectedItems().size() == 2) {
compare.setDisable(false);
} else {
compare.setDisable(true);
}
});
commonsBaseGridView.setContextMenu(historyContextMenu);
Scene scene = new Scene(borderPane);
Stage stage = new Stage();
stage.initOwner(SharedMemory.getPrimaryStage());
stage.setScene(scene);
stage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations