if (rc instanceof ComplexRecipeComponent) { return insertComplexLibRecipe(rc, recipeId); } else { return insertSimpleLibRecipe(rc, recipeId);
if (log.isDebugEnabled()) { log.debug("insertLibRecipe updating old ID " + recipeId + " with new class " + rc.getClass().getName() + " and name " + rc.getRecipeName()); }   executeUpdate(dbp.getQuery("deleteLibRecipeArgs", substitutions));   executeUpdate(dbp.getQuery("updateLibRecipe", substitutions)); } else {  recipeId = getNextId("queryMaxRecipeId", "RECIPE-"); substitutions.put(":recipe_id:", recipeId); substitutions.put(":java_class:", rc.getClass().getName()); substitutions.put(":description:", "No description available"); executeUpdate(dbp.getQuery("insertLibRecipe", substitutions)); }   int order = 0; for (Iterator j = rc.getLocalPropertyNames(); j.hasNext(); ) { CompositeName pname = (CompositeName) j.next(); Property prop = rc.getProperty(pname); if (prop == null) { prop = rc.getInvisibleProperty(pname); if (prop == null) { if (log.isErrorEnabled()) { log.error("Saving recipe " + rc.getRecipeName() + " under ID " + recipeId + " couldn't find property " + pname + ". Will continue.", new Throwable()); } continue; } } Object val = prop.getValue(); if (val == null) continue; String sval = val.toString(); if (sval.equals("")) continue; String name = pname.last().toString(); substitutions.put(":arg_name:", name); substitutions.put(":arg_value:", sval); substitutions.put(":arg_order:", String.valueOf(order++)); if(log.isDebugEnabled()) { log.debug("Write prop: " + name + " and val: " + sval + " to database"); } executeUpdate(dbp.getQuery("insertLibRecipeProp", substitutions)); } return recipeId; } catch (SQLException sqle) { log.error("Exception saving recipe " + rc.getRecipeName() + " in insertLibRecipe", sqle); return null;
  private String insertLibRecipe(RecipeComponent rc,				 String recipeId) throws SQLException {    if (rc instanceof ComplexRecipeComponent) {      return insertComplexLibRecipe(rc, recipeId);    } else {      return insertSimpleLibRecipe(rc, recipeId);    }  }