Пример #1
0
 /**
  * Updates an entry
  *
  * @param id The ID of the Entry to update
  */
 public static void editEntry(long id) throws EntryDoesNotExistException {
   Entry ent = null;
   try {
     ent = WinebookDAO.getEntry(id);
     WinebookDAO.editEntry(ent);
   } catch (DAException e) {
     throw new EntryDoesNotExistException(e);
   }
 }
Пример #2
0
 /**
  * Adds a photo to an entry
  *
  * @param id The ID of the entry to add the photo to
  * @param p The Photo to add to the entry
  */
 public static void addPhoto(long id, Photo p) {
   Entry ent = null;
   try {
     ent = WinebookDAO.getEntry(id);
     ent.addPhoto(p);
     WinebookDAO.editEntry(ent);
   } catch (DAException e) {
     // TODO
   }
 }
Пример #3
0
 /**
  * Removes a wine from an entry
  *
  * @param entryid The ID of the entry to remove the wine from
  * @param w The wine to remove from the entry
  */
 public static void removeWine(long entryid, Wine w) {
   Entry ent = null;
   try {
     ent = WinebookDAO.getEntry(entryid);
     ent.removeWine(w);
     WinebookDAO.editEntry(ent);
   } catch (DAException e) {
     // TODO
   }
 }