Class CinemaRatingService

java.lang.Object
com.esprit.services.cinemas.CinemaRatingService
All Implemented Interfaces:
IService<CinemaRating>

public class CinemaRatingService extends Object implements IService<CinemaRating>
  • Field Details

  • Constructor Details

    • CinemaRatingService

      public CinemaRatingService()
      Performs CinemaRatingService operation.
  • Method Details

    • create

      public void create(CinemaRating cinemaRating)
      Specified by:
      create in interface IService<CinemaRating>
    • update

      public void update(CinemaRating cinemaRating)
      Specified by:
      update in interface IService<CinemaRating>
    • delete

      public void delete(CinemaRating cinemaRating)
      Specified by:
      delete in interface IService<CinemaRating>
    • read

      public List<CinemaRating> read()
      Specified by:
      read in interface IService<CinemaRating>
    • getRatingForClientAndCinema

      public Integer getRatingForClientAndCinema(Long clientId, Long cinemaId)
      Retrieves the RatingForClientAndCinema value.
      Returns:
      the RatingForClientAndCinema value
    • getAverageRating

      public Double getAverageRating(Long cinemaId)
      Retrieves the AverageRating value.
      Returns:
      the AverageRating value
    • getTopRatedCinemas

      public List<Cinema> getTopRatedCinemas()
      Retrieves the TopRatedCinemas value.
      Returns:
      the TopRatedCinemas value
    • deleteByClientAndCinema

      private void deleteByClientAndCinema(Long clientId, Long cinemaId)
    • getCommentsByCinemaId

      public List<CinemaComment> getCommentsByCinemaId(Long cinemaId)
      Retrieves the CommentsByCinemaId value.
      Returns:
      the CommentsByCinemaId value
    • buildCinemaRating

      private CinemaRating buildCinemaRating(ResultSet rs)
    • buildCinemaComment

      private CinemaComment buildCinemaComment(ResultSet rs)