private List<Cake> retrieveCakes(List<Long> ids) { final List<IDBCake> dbCakes = dao.getCakes(ids); if (dbCakes == null) { throw new RuntimeException("Get: Cakes with <" + ids + "> not found"); } return this.cakeConverter.buildCakes(dbCakes); }
private void putCakeInDB(DBCake dbCake) { try { dao.addCake(dbCake); } catch (DBCakeDAOException e) { throw new RuntimeException("Get: No Cakes were added to DB", e); } }
private List<Cake> retrieveAllCakes() { final List<IDBCake> dbCakes = dao.getAllCakes(); if (dbCakes.isEmpty()) { System.out.println("Get: No Cakes found"); } return this.cakeConverter.buildCakes(dbCakes); }