Iterator iter = getProperties(); while(iter.hasNext()) { Property p = (Property)iter.next(); if(p.getName().last().toString().startsWith("$$CP")) { removeProperty(p); } }
  public boolean saveToDatabase() {    // The only way to preserve the target overrides in the children is to make them    // arguments of the parent, save, and then remove them from the parent.    for(int i=0; i < getChildCount(); i ++) {      ComponentBase child = (ComponentBase)getChild(i);      if(child.getProperty(PROP_TARGET_COMPONENT_QUERY) != null) {        addProperty(("$$CP=" + child.getComponentClassName() + "-" + i), child.getProperty(PROP_TARGET_COMPONENT_QUERY).getValue());      }    }    boolean retVal = super.saveToDatabase();    // Save is finished, remove the properties from the parent.    Iterator iter = getProperties();    while(iter.hasNext()) {      Property p = (Property)iter.next();      if(p.getName().last().toString().startsWith("$$CP")) {        removeProperty(p);      }    }    return retVal;  }