Package adios.model

Examples of adios.model.Ingredient


  @Autowired
  private TableRecipeIngredientDao tableRecipeIngredientDao;
 
 
  public boolean addIngredient (Ingredient4Recipe i4r){
    Ingredient i = new Ingredient();
    i.setName(i4r.getName());
    try{
      i = ingredientDao.getIngredientForName(i);     
    }catch (Exception e){
      ingredientDao.persist(i);
      i=ingredientDao.getIngredientForName(i);
    }finally{
      i4r.setIngrdientId(i.getIngredientId());
    }
   
    TableRecipeIngredient tab= new TableRecipeIngredient();
    tab.setRecipeId(i4r.getRecipeId());
    tab.setIngredientId(i4r.getIngrdientId());
View Full Code Here


   
    ArrayList<Ingredient4Recipe> i4rList = new ArrayList<Ingredient4Recipe>();
    if(ingredientTableList != null){
      Iterator<TableRecipeIngredient> it = ingredientTableList.iterator();
      TableRecipeIngredient tab=null;
      Ingredient i =null;
      while(it.hasNext()){
        Ingredient4Recipe i4rResult = new Ingredient4Recipe();
        tab = it.next();
        i = ingredientDao.getIngredientForId(tab.getIngredientId());
        i4rResult.setName(i.getName());
        i4rResult.setQuantity(tab.getIngQuantity());
        i4rResult.setUnit(tab.getIngUnit());
       
        i4rList.add(i4rResult);
      }
View Full Code Here

   
    ArrayList<Ingredient4Recipe> i4rList = new ArrayList<Ingredient4Recipe>();

    ArrayList<Ingredient> ingList = ingredientDao.getMostUsedIng();
    Iterator<Ingredient> it =  ingList.iterator();
    Ingredient i =null;
   
    while(it.hasNext()){
      Ingredient4Recipe i4rResult = new Ingredient4Recipe();
      i = it.next();     
      i4rResult.setName(i.getName());
      i4rResult.setIngrdientId(i.getIngredientId());
      i4rList.add(i4rResult);
    }
   
    return i4rList; 
  }
View Full Code Here

TOP

Related Classes of adios.model.Ingredient

Copyright © 2018 www.massapicom. 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.