use of kyj.Fx.dao.wizard.core.model.vo.TbpSysDaoFieldsDVO in project Gargoyle by callakrsos.
the class DaoWizardViewController method tbMethodsOnMouseClick.
/**
* 메소드 테이블 로우 더블클릭 이벤트처리.
*
* 저장되어있는 SQL을 UI에 보여주는 기능을한다.
*
* @작성자 : KYJ
* @작성일 : 2015. 10. 21.
* @param e
*/
@FXML
public void tbMethodsOnMouseClick(MouseEvent e) {
if (e.getClickCount() == 2) {
// tbParams.getItems().clear();
List<TbpSysDaoFieldsDVO> selectedFieldItems = getSelectedFieldItems();
TbpSysDaoMethodsDVO selectedMethodItem = getSelectedMethodItem();
if (selectedMethodItem != null) {
String sqlBody = selectedMethodItem.getSqlBody();
txtSql.setContent(sqlBody);
List<TbpSysDaoColumnsDVO> tbpSysDaoColumnsDVOList = selectedMethodItem.getTbpSysDaoColumnsDVOList();
tbMappings.setItems(FXCollections.observableArrayList(tbpSysDaoColumnsDVOList));
}
if (selectedFieldItems != null)
tbParams.setItems(FXCollections.observableList(selectedFieldItems));
}
}
use of kyj.Fx.dao.wizard.core.model.vo.TbpSysDaoFieldsDVO in project Gargoyle by callakrsos.
the class DaoWizardViewController method addMenuParamOnAction.
/**
* 파라미터 항목을 추가한다.
*
* @작성자 : KYJ
* @작성일 : 2015. 11. 6.
* @param e
*/
@Deprecated
public void addMenuParamOnAction(ActionEvent e) {
TbpSysDaoFieldsDVO e2 = new TbpSysDaoFieldsDVO();
tbParams.getItems().add(e2);
// List<TbpSysDaoFieldsDVO> tbpSysDaoFieldsDVOList =
// this.getSelectedMethodItem().getTbpSysDaoFieldsDVOList();
// tbpSysDaoFieldsDVOList.add(e2);
}
use of kyj.Fx.dao.wizard.core.model.vo.TbpSysDaoFieldsDVO in project Gargoyle by callakrsos.
the class DaoWizardTest method test.
/********************************
* 작성일 : 2016. 4. 16. 작성자 : KYJ
*
*
* DAO Wizard Test Case
*
* @throws Exception
********************************/
@Test
public void test() throws Exception {
// *******클래스 정보
ClassMeta classMeta = new ClassMeta("Hello");
// ******메소드 정보
TbpSysDaoMethodsDVO methodMeta = new TbpSysDaoMethodsDVO(classMeta);
// 메소드명
methodMeta.setMethodName("simple");
// SQL문
methodMeta.setSqlBody("select 1 as ss from dual where name = :name");
// 데이터베이스 타입에 대한정보
TbpSysDaoColumnsDVO tbpSysDaoColumnsDVO = new TbpSysDaoColumnsDVO();
tbpSysDaoColumnsDVO.setColumnName("name");
tbpSysDaoColumnsDVO.setColumnType("VARCHAR");
methodMeta.setTbpSysDaoColumnsDVOList(Arrays.asList(tbpSysDaoColumnsDVO));
// 테스트 필드에 대한정보.. (이부분은 크게 중요치는않음.)
TbpSysDaoFieldsDVO tbpSysDaoFieldsDVO = new TbpSysDaoFieldsDVO();
tbpSysDaoFieldsDVO.setFieldName("name");
tbpSysDaoFieldsDVO.setTestValue("kyj");
tbpSysDaoFieldsDVO.setType("java.lang.String");
methodMeta.setTbpSysDaoFieldsDVOList(Arrays.asList(tbpSysDaoFieldsDVO));
// 리턴타입에 대한정보
methodMeta.setResultVoClass("com.sample.Hello");
// DAO생성을 위한준비
DaoWizard<ClassMeta, TbpSysDaoMethodsDVO, FieldMeta> wizard = new DaoWizard(classMeta, Arrays.asList(methodMeta));
// 반드시호출.
wizard.build();
// 확인
System.out.println(wizard.toText());
Assert.assertNotNull(wizard.toText());
}
use of kyj.Fx.dao.wizard.core.model.vo.TbpSysDaoFieldsDVO in project Gargoyle by callakrsos.
the class DaoBaseResultSetStatement method convert.
public String convert() {
// 결과
StringBuffer resultPart = new StringBuffer();
// resultSet파트
StringBuffer returnPart = new StringBuffer();
// query 파트
StringBuffer resultSetMappingPart = new StringBuffer();
String stringBufferVarName = mapper.getStringBufferVarName();
String parameterMapVarName = mapper.getParameterMapVarName();
String resultSetVarName = mapper.getResultSetVarName();
String rowNumVarName = mapper.getRowNumVarName();
List<TbpSysDaoFieldsDVO> inputFields = mapper.getT().getTbpSysDaoFieldsDVOList();
List<TbpSysDaoColumnsDVO> columns = mapper.getT().getTbpSysDaoColumnsDVOList();
String resultVoClass = mapper.getT().getResultVoClass();
String type = getType(resultVoClass);
/* 람다 expression */
/* parameter part */
returnPart.append(stringBufferVarName).append(".toString()").append(",");
returnPart.append(parameterMapVarName).append(",(").append(resultSetVarName).append(",").append(rowNumVarName).append(")");
returnPart.append("->{\n");
/* [시작] Vo생성 statement */
addImport(mapper.getFxDao(), resultVoClass);
String varName = getVarName(resultVoClass);
resultSetMappingPart.append(type).append(" ").append(varName).append(" = new ").append(type).append("();\n");
/* [끝] Vo생성 statement */
IResultSetConverter resultSetConverter = resultSetConverter();
for (TbpSysDaoColumnsDVO col : columns) {
String statement = resultSetConverter.convert(varName, resultSetVarName, col);
resultSetMappingPart.append(statement).append("\n");
}
returnPart.append(applyedTabKeys(resultSetMappingPart.toString(), 1));
returnPart.append(applyedTabKeys("return " + varName + ";", 1));
returnPart.append("}\n");
/* return문 베이스 */
//.append(" query(").append(returnPart.toString()).append(");");
resultPart.append(baseReturnStatement.returnKeyword()).append(baseReturnStatement.getReturnStatement(returnPart.toString()));
return applyedTabKeys(resultPart.toString(), this.appendTabKeyCount);
}
use of kyj.Fx.dao.wizard.core.model.vo.TbpSysDaoFieldsDVO in project Gargoyle by callakrsos.
the class GargoyleDbUtilBaseFxExtractDaoMethod method convert.
/* (non-Javadoc)
* @see kyj.Fx.dao.wizard.core.DaoBaseResultSetStatement#convert()
*/
@Override
public String convert() {
// 결과
StringBuffer resultPart = new StringBuffer();
// resultSet파트
StringBuffer returnPart = new StringBuffer();
// query 파트
StringBuffer resultSetMappingPart = new StringBuffer();
IRetrunStatement baseReturnStatement = getBaseReturnStatement();
T mapper = getMapper();
int appendTabKeyCount = getAppendTabKeyCount();
String stringBufferVarName = mapper.getStringBufferVarName();
String parameterMapVarName = mapper.getParameterMapVarName();
String resultSetVarName = mapper.getResultSetVarName();
String rowNumVarName = mapper.getRowNumVarName();
List<TbpSysDaoFieldsDVO> inputFields = mapper.getT().getTbpSysDaoFieldsDVOList();
List<TbpSysDaoColumnsDVO> columns = mapper.getT().getTbpSysDaoColumnsDVOList();
String resultVoClass = mapper.getT().getResultVoClass();
String type = getType(resultVoClass);
/* 람다 expression */
/* parameter part */
returnPart.append(stringBufferVarName).append(".toString()").append(",");
returnPart.append(parameterMapVarName).append(",(").append(resultSetVarName).append(",").append(rowNumVarName).append(")");
returnPart.append("->{\n");
/* [시작] Vo생성 statement */
addImport(mapper.getFxDao(), resultVoClass);
String varName = getVarName(resultVoClass);
resultSetMappingPart.append(type).append(" ").append(varName).append(" = new ").append(type).append("();\n");
/* [끝] Vo생성 statement */
IResultSetConverter resultSetConverter = resultSetConverter();
for (TbpSysDaoColumnsDVO col : columns) {
String statement = resultSetConverter.convert(varName, resultSetVarName, col);
resultSetMappingPart.append(statement).append("\n");
}
returnPart.append(applyedTabKeys(resultSetMappingPart.toString(), 1));
returnPart.append(applyedTabKeys("return " + varName + ";", 1));
returnPart.append("}\n");
/* return문 베이스 */
//.append(" query(").append(returnPart.toString()).append(");");
resultPart.append(baseReturnStatement.returnKeyword()).append(baseReturnStatement.getReturnStatement(returnPart.toString()));
return applyedTabKeys(resultPart.toString(), appendTabKeyCount);
}
Aggregations