Changeset 64ee7f4


Ignore:
Timestamp:
02/08/23 00:06:18 (23 months ago)
Author:
DenicaKj <dkorvezir@…>
Branches:
master
Children:
89438a3
Parents:
8d49568
Message:

Fixes

Location:
src/main/java/com/example/moviezone
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/model/Seat.java

    r8d49568 r64ee7f4  
    1919    @ManyToOne
    2020    @JoinColumn(name = "id_room")
    21     Projection_Room projection_room;
     21    Projection_Room projection;
    2222    @ManyToOne
    2323    @JoinColumn(name = "id_category")
  • src/main/java/com/example/moviezone/repository/ProjectionIsPlayedInRoomRepository.java

    r8d49568 r64ee7f4  
    44import com.example.moviezone.model.manytomany.ProjectionIsPlayedInRoomId;
    55import org.springframework.data.jpa.repository.JpaRepository;
     6import org.springframework.data.jpa.repository.Query;
     7import org.springframework.data.repository.query.Param;
    68
    79import java.util.List;
    810
    911public interface ProjectionIsPlayedInRoomRepository extends JpaRepository<ProjectionIsPlayedInRoom, ProjectionIsPlayedInRoomId> {
    10     List<ProjectionIsPlayedInRoom> findAllById_projection(Integer id_projection);
     12    @Query("SELECT pir FROM ProjectionIsPlayedInRoom pir WHERE pir.id_projection = :id_projection")
     13    List<ProjectionIsPlayedInRoom> findAllByProjectionId(@Param("id_projection") Integer id_projection);
    1114}
  • src/main/java/com/example/moviezone/repository/SeatRepository.java

    r8d49568 r64ee7f4  
    1010@Repository
    1111public interface SeatRepository extends JpaRepository<Seat,Integer> {
    12     List<Seat> findAllByProjection_room(Projection_Room projection_room);
     12    List<Seat> findAllByProjection(Projection_Room projection);
    1313}
  • src/main/java/com/example/moviezone/service/Impl/ProjectionIsPlayedInRoomServiceImpl.java

    r8d49568 r64ee7f4  
    11package com.example.moviezone.service.Impl;
    22
     3import com.example.moviezone.model.manytomany.ProjectionIsPlayedInRoom;
    34import com.example.moviezone.repository.ProjectionIsPlayedInRoomRepository;
    45import com.example.moviezone.service.ProjectionIsPlayedInRoomService;
    56import org.springframework.stereotype.Service;
     7
     8import java.util.List;
     9import java.util.Optional;
    610
    711@Service
     
    1317    }
    1418
     19    @Override
     20    public List<ProjectionIsPlayedInRoom> getProjectionPlayedInRoom(Integer id) {
     21        return projectionIsPlayedInRoomRepository.findAllByProjectionId(id);
     22    }
    1523}
  • src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java

    r8d49568 r64ee7f4  
    2424    @Override
    2525    public List<Seat> findAllByProjection_Room(Projection_Room projection_room) {
    26         return seatRepository.findAllByProjection_room(projection_room);
     26        return seatRepository.findAllByProjection(projection_room);
    2727    }
    2828}
  • src/main/java/com/example/moviezone/service/ProjectionIsPlayedInRoomService.java

    r8d49568 r64ee7f4  
    11package com.example.moviezone.service;
    22
     3import com.example.moviezone.model.Film;
     4import com.example.moviezone.model.manytomany.ProjectionIsPlayedInRoom;
     5
     6import java.util.List;
     7import java.util.Optional;
     8
    39public interface ProjectionIsPlayedInRoomService {
    4 
     10    List<ProjectionIsPlayedInRoom> getProjectionPlayedInRoom(Integer id);
    511
    612}
  • src/main/java/com/example/moviezone/web/HomeController.java

    r8d49568 r64ee7f4  
    3636private final CinemaOrganizesEventService cinemaOrganizesEventService;
    3737private final CinemaPlaysFilmService cinemaPlaysFilmService;
    38 private final ProjectionIsPlayedInRoomRepository projectionIsPlayedInRoomRepository;
    39 
    40 
    41     public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService, CinemaService cinemaService, CinemaOrganizesEventService cinemaOrganizesEventService, CinemaPlaysFilmService cinemaPlaysFilmService, ProjectionIsPlayedInRoomRepository projectionIsPlayedInRoomRepository) {
    42 
     38private final ProjectionIsPlayedInRoomService projectionIsPlayedInRoomService;
     39
     40
     41    public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService, CinemaService cinemaService, CinemaOrganizesEventService cinemaOrganizesEventService, CinemaPlaysFilmService cinemaPlaysFilmService, ProjectionIsPlayedInRoomService projectionIsPlayedInRoomService) {
    4342        this.filmService = filmService;
    4443        this.userService = userService;
     
    5150        this.cinemaOrganizesEventService = cinemaOrganizesEventService;
    5251        this.cinemaPlaysFilmService = cinemaPlaysFilmService;
    53         this.projectionIsPlayedInRoomRepository = projectionIsPlayedInRoomRepository;
     52        this.projectionIsPlayedInRoomService = projectionIsPlayedInRoomService;
    5453    }
    5554
     
    285284
    286285
    287         List<ProjectionIsPlayedInRoom> p= projectionIsPlayedInRoomRepository.findAllById_projection(id_projection);
     286        List<ProjectionIsPlayedInRoom> p= projectionIsPlayedInRoomService.getProjectionPlayedInRoom(id_projection);
    288287
    289288        model.addAttribute("projection",projection);
Note: See TracChangeset for help on using the changeset viewer.