Examples of Ingredient


Examples of fr.valtech.many2many.domain.Ingredient

    @Test
    public void testUpdateRecipeByDeletingDetachedIngredients()
            throws Exception {
        // enregistre la recette avec 2 ingredients (salade et jambon)
        Assert.assertNull(recipe.getId());
        Ingredient salade = new Ingredient();
        salade.setLabel("salade");
        RecipeIngredient _1feuilleSalade = new RecipeIngredient();
        _1feuilleSalade.setIngredient(salade);
        _1feuilleSalade.setAmount("1 feuille");
        recipe.addRecipeIngredient(_1feuilleSalade);
        recipeDAO.save(recipe);
View Full Code Here

Examples of fr.valtech.many2many.domain.Ingredient

        detachedRecipe.setTitle(r.getTitle());

        Iterator<RecipeIngredient> it = r.getRecipeIngredients().iterator();
        while (it.hasNext()) {
            RecipeIngredient ri = it.next();
            Ingredient i = new Ingredient();
            i.setId(ri.getIngredient().getId());
            RecipeIngredient detachedRi = new RecipeIngredient(i,
                    ri.getAmount());
            detachedRecipe.addRecipeIngredient(detachedRi);
        }
View Full Code Here

Examples of fr.valtech.many2many.domain.Ingredient

    private void reatachIngredients(Recipe recipe) {

        for (Iterator<RecipeIngredient> it = recipe.getRecipeIngredients()
                .iterator(); it.hasNext();) {
            RecipeIngredient ri = it.next();
            Ingredient ingredient = ri.getIngredient();
            if (ingredient.getId() != null && ingredient.getId() != 0) {
                Ingredient reference = getEntityManager().getReference(
                        Ingredient.class, ingredient.getId());
                ri.setIngredient(reference);
            } else {
                getEntityManager().persist(ingredient);
            }
View Full Code Here

Examples of fr.valtech.many2many.domain.Ingredient

                cb.parameter(String.class, "label")));
        TypedQuery<Ingredient> tq = getEntityManager().createQuery(
                criteriaQuery);
        tq.setParameter("label", label);

        Ingredient ingredient = null;
        try {
            ingredient = tq.getSingleResult();
        } catch (NoResultException nre) {
            getLogger().info("no result found");
        }
View Full Code Here

Examples of mbj.robotdriver.experimentplate.Ingredient

          }
          parentRobotDriver.usedIngredients().addIfNotPresent(aIngredient);
        }
      }
      // add the Water at the beginning of the List of usedIngredients.
      Ingredient water = new Ingredient(parentRobotDriver.thePlate().waterVolume());
      parentRobotDriver.usedIngredients().add(0, water);
      // if OK
      parentRobotDriver.getContentPane().removeAll();
      parentRobotDriver.pack();
      parentRobotDriver.repaint();
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.