use of com.cubrid.common.core.common.model.Trigger in project cubrid-manager by CUBRID.
the class CreateTriggerDialog method generateSqlText.
/**
*
* @return Sql string buffer
*/
private StringBuffer generateSqlText() {
// FIXME move this logic to core module
StringBuffer sql = new StringBuffer();
Trigger newTrigger = getNewTrigger();
if (null == trigger) {
sql.append(TriggerDDL.getDDL(newTrigger));
} else {
sql.append(TriggerDDL.getDDL(trigger));
sql.append(StringUtil.NEWLINE);
sql.append(StringUtil.NEWLINE);
sql.append(StringUtil.NEWLINE);
sql.append(TriggerDDL.getAlterDDL(trigger, newTrigger));
}
return sql;
}
use of com.cubrid.common.core.common.model.Trigger in project cubrid-manager by CUBRID.
the class GetTriggerInfoTaskTest method testReceive.
public void testReceive() throws Exception {
String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/cubrid/trigger/task/test.message/gettriggerinfo_receive");
String msg = Tool.getFileContent(filepath);
TreeNode node = MessageUtil.parseResponse(msg);
List<Trigger> list = ModelUtil.getTriggerList(node.getChildren().get(0));
String action = "update resort set number_of_pools=new.number_of_pools-1 where \"name\"=obj.\"name\"";
assertEquals(2, list.size());
assertEquals("limit_pools", list.get(0).getName());
assertEquals("BEFORE", list.get(0).getConditionTime());
assertEquals("UPDATE", list.get(0).getEventType());
assertEquals(action, list.get(0).getAction());
assertEquals("resort", list.get(0).getTarget_class());
assertEquals("number_of_pools", list.get(0).getTarget_att());
assertEquals("new.number_of_pools>0", list.get(0).getCondition());
assertEquals("BEFORE", list.get(0).getActionTime());
assertEquals("ACTIVE", list.get(0).getStatus());
assertEquals("00.01", list.get(0).getPriority());
}
Aggregations