Ejemplo n.º 1
0
 public void removeUser(String username) {
   try {
     sao.delete(username);
   } catch (DataAccessException e) {
     System.out.println("(User Model) Unable to delete product");
   }
 }
Ejemplo n.º 2
0
  @Override
  public int deleteRoomOffer(final DeleteRoomCommand command) throws Exception {

    checkNotNull(command, "command");

    final RoomOffer clientRoomToDelete = command.getRoomOfferToDelete();
    final int index = clientRoomToDelete.getIndex();
    long lock = NOT_LOCKED;
    try {
      lock = roomOfferDao.lock(index);
      final RoomOffer dbRoomToDelete = roomOfferDao.read(index);

      checkStaleRoomData(clientRoomToDelete, dbRoomToDelete);

      roomOfferDao.delete(index, lock);
      return index;
    } catch (final Exception e) {
      logger.throwing(getClass().getName(), "deleteRoomOffer", e);
      throw new Exception(e);
    } finally {
      unlockQuietly(index, lock);
    }
  }