コード例 #1
0
 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);
 }
コード例 #2
0
 private void putCakeInDB(DBCake dbCake) {
   try {
     dao.addCake(dbCake);
   } catch (DBCakeDAOException e) {
     throw new RuntimeException("Get: No Cakes were added to DB", e);
   }
 }
コード例 #3
0
  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);
  }