Examples of addRecipeIngredient()


Examples of fr.valtech.many2many.domain.Recipe.addRecipeIngredient()

        // les ingredients détachés
        Ingredient i1 = new Ingredient();
        i1.setId(it.next().getIngredient().getId());
        RecipeIngredient ri1 = new RecipeIngredient(i1, "200g");
        recipe2.addRecipeIngredient(ri1);

        Ingredient i2 = new Ingredient();
        i2.setId(it.next().getIngredient().getId());
        RecipeIngredient ri2 = new RecipeIngredient(i2, "300g");
        recipe2.addRecipeIngredient(ri2);
View Full Code Here

Examples of fr.valtech.many2many.domain.Recipe.addRecipeIngredient()

        recipe2.addRecipeIngredient(ri1);

        Ingredient i2 = new Ingredient();
        i2.setId(it.next().getIngredient().getId());
        RecipeIngredient ri2 = new RecipeIngredient(i2, "300g");
        recipe2.addRecipeIngredient(ri2);

        assertFalse(i1.getId().equals(i2.getId()));
        assertFalse(i1.equals(i2));

        recipeDAO.save(recipe2);
View Full Code Here

Examples of fr.valtech.many2many.domain.Recipe.addRecipeIngredient()

        pates.setLabel("pates");

        RecipeIngredient _100gPates = new RecipeIngredient(pates, "200g");

        searchedRecipe = detachRecipe(recipe);
        searchedRecipe.addRecipeIngredient(_100gPates);
        recipeDAO.merge(searchedRecipe);
        flushSession();

        recipe = recipeDAO.getEntity(Recipe.class, searchedRecipe.getId());
        Assert.assertEquals(2, recipe.getRecipeIngredients().size());
View Full Code Here

Examples of fr.valtech.many2many.domain.Recipe.addRecipeIngredient()

        // ajoute un nouvel ingredient (sans id)
        Ingredient pates = new Ingredient();
        pates.setLabel("pates");
        RecipeIngredient _100gPates = new RecipeIngredient(pates, "100g");

        searchedRecipe.addRecipeIngredient(_100gPates);
        recipeDAO.merge(searchedRecipe);
        flushSession();

        recipe = recipeDAO.getEntity(Recipe.class, searchedRecipe.getId());
        Assert.assertEquals(2, recipe.getRecipeIngredients().size());
View Full Code Here

Examples of fr.valtech.many2many.domain.Recipe.addRecipeIngredient()

        Recipe searchedRecipe = detachRecipe(recipe);
        // ajoute un nouvel ingredient (avec id)
        RecipeIngredient _1feuilleSalade = new RecipeIngredient(saladeDetached,
                "1 feuille");
        searchedRecipe.addRecipeIngredient(_1feuilleSalade);

        recipeDAO.merge(searchedRecipe);
        flushSession();

        recipe = recipeDAO.getEntity(Recipe.class, searchedRecipe.getId());
View Full Code Here

Examples of fr.valtech.many2many.domain.Recipe.addRecipeIngredient()

            RecipeIngredient ri = it.next();
            Ingredient i = new Ingredient();
            i.setId(ri.getIngredient().getId());
            RecipeIngredient detachedRi = new RecipeIngredient(i,
                    ri.getAmount());
            detachedRecipe.addRecipeIngredient(detachedRi);
        }

        return detachedRecipe;

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.