public void rateApplication() { Rate r = new Rate(); r.setRate(rate); r.setRateApplication(application); if (user.getUserId() != null) { r.setRateUser(user); } service.persist(r); List<Rate> rates = application.getRateList(); rates.add(r); application.setRateList(rates); }
public double findAverage(Application a) { return service.findApplicationRateAverage(a.getApplicationId()); }