private void createAddRecipeBatch(Statement stmt, Recipe recipe) throws SQLException, DataStoreException{
        List<RecipeSection> sections = recipe.getSections();
        List<Ingredient> ingredients = retrieveAllIngredients();

        stmt.addBatch("INSERT INTO recipes VALUES ('" + escapeQuotes(recipe.getName()) + "', " +
                recipe.getTime() + ", " + recipe.getImage() + ", " + recipe.getCalories() + ", '" + recipe.getSource() + "', " + recipe.getPortions() + ")");

        int count = 0;
        //Add sections
        for(RecipeSection section: sections){
            //Add all unknown ingredients.
            for(RecipeIngredient recipeIngredient: section.getIngredients()){
                Ingredient ingredient = recipeIngredient.getIngredient();
                if(!ingredients.contains(ingredient)){
                    stmt.addBatch("INSERT INTO ingredients (name_singular, name_plural, common) VALUES ('" + escapeQuotes(ingredient.getSingular()) + "', '" +
                            escapeQuotes(ingredient.getPlural()) + "', " +
                            ingredient.isCommon() + ")");
                    ingredients.add(ingredient);
                    isIngredientCacheValid = false;
                }
            }

            //Add SectionIngredients and link
            stmt.addBatch("INSERT INTO sections (headline, text) VALUES ('" + escapeQuotes(section.getHeadline()) +
                    "', '" + escapeQuotes(section.getText()) + "')");
            stmt.addBatch("SET @LAST_ID = LAST_INSERT_ID()");
            for(RecipeIngredient recipeIngredient: section.getIngredients()){
                Ingredient ingredient = recipeIngredient.getIngredient();
                stmt.addBatch("INSERT INTO ingredients_per_section (section_id, name_singular, suffix, prefix) SELECT @LAST_ID, '" + escapeQuotes(ingredient.getSingular()) +
                        "', '" +  escapeQuotes(recipeIngredient.getSuffix()) + "', '" +
                        escapeQuotes(recipeIngredient.getPrefix()) + "'");
            }

            count++;

            stmt.addBatch("INSERT INTO sections_per_recipe () SELECT '" + escapeQuotes(recipe.getName()) +
                    "', @LAST_ID, " + count);
        }
    }