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;
 }
 private List<String> convertTriggersToNames(List<Trigger> triggers) {
   List<String> names = new ArrayList<String>();
   for (Trigger t : triggers) {
     names.add(t.getName());
   }
   return names;
 }
Esempio n. 3
0
 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);
 }