public Offer getOffer(String username) { if (username == null) { return null; } List<Offer> offers = offersDAO.getOffers(username); if (offers.size() == 0) { return null; } return offers.get(0); }
public boolean hasOffer(String name) { if (name == null) { return false; } List<Offer> offers = offersDAO.getOffers(name); if (offers.size() == 0) { return false; } return true; }
public void delete(int id) { offersDAO.delete(id); }
public void saveOrUpdate(Offer offer) { offersDAO.saveOrUpdate(offer); }
@Secured({"ROLE_USER", "ROLE_ADMIN"}) public void create(Offer offer) { offersDAO.saveOrUpdate(offer); }
public List<Offer> getCurrent() { return offersDAO.getOffers(); }