@Override public Item getItem(int id) { Item item = itemDao.getItem(id); Category category = categoryDao.getCategoryByItemId(id); item.setCategory(category); return item; }
@Override public List<Item> getItems() { List<Item> items = itemDao.getItems(); for (Item item : items) { Category category = categoryDao.getCategoryByItemId(item.getId()); item.setCategory(category); } return items; }