Package com.softserve.academy.food.entity

Examples of com.softserve.academy.food.entity.OrderInfo


    @Autowired
    private IDishDao dishDao;

    @Transactional
    public void add(Map<Integer, Integer> dishIdsToQuantities) {
        OrderInfo order = new OrderInfo();
        order.setUser(userDao.get(getLogin()));
        order.setDate(new Date());

        List<OrderContents> ordercontents = new ArrayList<OrderContents>();

        for (Map.Entry<Integer, Integer> item : dishIdsToQuantities.entrySet()) {
            Dish dish = dishDao.get(item.getKey());
            ordercontents.add(new OrderContents(dish, item.getValue(), order));
        }

        order.setSpec(ordercontents);

        orderDao.add(order);
    }
View Full Code Here


        }
        this.spec = spec;
    }

    public OrderInfo toEntity() {
        return new OrderInfo(this);
    }
View Full Code Here

TOP

Related Classes of com.softserve.academy.food.entity.OrderInfo

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.