Ignore:
Timestamp:
02/07/23 14:48:59 (22 months ago)
Author:
DenicaKj <dkorvezir@…>
Branches:
master
Children:
cb5debb
Parents:
3242ef4
Message:

Trying To Call A procedure from databasee

Location:
src/main/java/com/example/moviezone
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/repository/FilmRepository.java

    r3242ef4 r3650316  
    22
    33import com.example.moviezone.model.Film;
     4import com.example.moviezone.model.procedures.FilmsReturnTable;
    45import org.springframework.data.jpa.repository.JpaRepository;
    56import org.springframework.data.jpa.repository.query.Procedure;
     
    910
    1011public interface FilmRepository extends JpaRepository<Film,Integer> {
    11 
     12    @Procedure("project.getFilmsFromCinema")
     13    List<FilmsReturnTable> getFilmsFromCinema(int id);
    1214}
  • src/main/java/com/example/moviezone/web/HomeController.java

    r3242ef4 r3650316  
    3131
    3232    public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService, CinemaService cinemaService, CinemaOrganizesEventService cinemaOrganizesEventService, CinemaPlaysFilmService cinemaPlaysFilmService) {
     33       
    3334        this.filmService = filmService;
    3435        this.userService = userService;
     
    124125    @GetMapping("/films")
    125126    public String getFilmsPage(Model model){
     127        model.addAttribute("cinemas",cinemaService.findAllCinemas());
    126128        model.addAttribute("films",filmService.findAllFilms());
    127129        model.addAttribute("bodyContent","films");
Note: See TracChangeset for help on using the changeset viewer.