if (! foundit) { if (log.isWarnEnabled()) log.warn("Unable to find component " + component + " to set override target query on: " + propName); }
  private void initTargetsFromDb() {    if(log.isDebugEnabled()) {      log.debug("In initTargetsFromDb");    }    Map substitutions = new HashMap();    if (recipeId != null) {      substitutions.put(":recipe_id", recipeId);      try {	Connection conn = DBUtils.getConnection();	try {	  Statement stmt = conn.createStatement();	  String query = DBUtils.getQuery("queryRecipeProperties", substitutions);          if(log.isDebugEnabled()) {            log.debug("initTargetsFromDb: Run query: " + query);          }	  ResultSet rs = stmt.executeQuery(query);	  while (rs.next()) {            String propName = rs.getString(1);            if(propName.startsWith("$$CP=")) {              int start = propName.indexOf("=");              String component = propName.substring(start+1);              // Find the Component and add the Property              if(log.isDebugEnabled()) {                log.debug("Looking for: " + component + " out of " + getChildCount() + " children");              }              for(int i=0; i < getChildCount(); i++) {                ConfigurableComponent cc = (ConfigurableComponent)getChild(i);//                 ComponentBase cc = (ComponentBase)getChild(i);		if (log.isDebugEnabled())		  log.debug("Considering child " + i + ": " + cc.getShortName());                if (cc instanceof ComponentBase) {                  String tag = ((ComponentBase)cc).getComponentClassName() + "-" + i;                  if(log.isDebugEnabled()) {                    log.debug("Compare with: " + tag);                  }                  if(tag.equals(component)) {                    if(log.isDebugEnabled()) {                      log.debug("Found Desired Parent: " + tag + " adding parameter");                    }                    cc.addProperty(PROP_TARGET_COMPONENT_QUERY, rs.getString(2));		    break;                  }                } else {		  // What kind of component is this?		  if (cc instanceof AgentComponent) {		    log.debug("not right - it's an Agent");		  }		}              } // loop over children            } else if (! propName.equals(ASSEMBLY_PROP)) {	      // Non child component property	      Property prop = getProperty(propName);	      if (prop != null) {		if (log.isDebugEnabled())		  log.debug("setting local prop " + propName + " to " + rs.getString(2));		prop.setValue(rs.getString(2));	      } else {		if (log.isDebugEnabled())		  log.debug("Adding new local prop " + propName + " with val " + rs.getString(2));		addProperty(propName, rs.getString(2));	      }	    }	  } // end of loop over props from db	  rs.close();	  stmt.close();	} finally {	  conn.close();	}      } catch (Exception e) {        if(log.isErrorEnabled()) {          log.error("Exception getting target properties for recipe " + getRecipeName(), e);        }      }    }      }