/* (non-Javadoc) * @see com.hangum.tadpole.rdb.core.editors.objects.table.scripts.RDBDDLScript#getTriggerScript(com.hangum.tadpole.dao.mysql.TriggerDAO) */ @Override public String getTriggerScript(TriggerDAO triggerDAO) throws Exception { SqlMapClient client = TadpoleSQLManager.getInstance(userDB); StringBuilder result = new StringBuilder(""); result.append("/* DROP PROCEDURE " + triggerDAO.getName() + "; */ \n\n"); List<String> srcProcList = client.queryForList("getTriggerScript", triggerDAO.getName()); for (int i = 0; i < srcProcList.size(); i++) { result.append(srcProcList.get(i)); } return result.toString(); }
/* (non-Javadoc) * @see com.hangum.tadpole.rdb.core.editors.objects.table.scripts.RDBDDLScript#getTriggerScript(com.hangum.tadpole.dao.mysql.TriggerDAO) */ @Override public String getTriggerScript(TriggerDAO triggerDAO) throws Exception { SqlMapClient client = TadpoleSQLManager.getInstance(userDB); StringBuilder result = new StringBuilder(""); Map srcList = (HashMap) client.queryForObject("getTriggerScript", triggerDAO.getTrigger()); String strSource = "" + srcList.get("SQL Original Statement"); strSource = StringUtils.substringAfterLast(strSource, "TRIGGER"); return "CREATE TRIGGER " + strSource; }