コード例 #1
0
 private String getTableTriggerId(Trigger g) {
   if (g == null) return null;
   String id = g.getName().replace(".", "-");
   Trigger group = g;
   while ((group = group.getParent()) != null) {
     id = group.getName().replace(".", "-") + "." + id;
   }
   return id;
 }
コード例 #2
0
 private List<String> convertTriggersToNames(List<Trigger> triggers) {
   List<String> names = new ArrayList<String>();
   for (Trigger t : triggers) {
     names.add(t.getName());
   }
   return names;
 }
コード例 #3
0
ファイル: Trigger.java プロジェクト: Rikard-Andersson/dbi
 public void setParent(Trigger newParent) {
   if (this.parent != null) parent.removeChild(this);
   if (newParent == null) {
     this.parent = newParent;
     return;
   }
   if (newParent.getTriggerType() == TRIGGER_TYPE_BASIC)
     throw new IllegalArgumentException("Parent trigger must be a COMPOSITE trigger");
   Trigger tmpParent = newParent;
   while (tmpParent != null) {
     if (tmpParent.getId().equals(this.getId())) {
       throw new IllegalArgumentException(
           "Parent reference loop occurred for "
               + tmpParent.getName()
               + " ("
               + tmpParent.getId()
               + ")");
     }
     tmpParent = tmpParent.getParent();
   }
   this.parent = newParent;
   this.parent.addChild(this);
 }