- Timestamp:
- 02/08/23 00:06:18 (23 months ago)
- Branches:
- master
- Children:
- 89438a3
- Parents:
- 8d49568
- 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 19 19 @ManyToOne 20 20 @JoinColumn(name = "id_room") 21 Projection_Room projection _room;21 Projection_Room projection; 22 22 @ManyToOne 23 23 @JoinColumn(name = "id_category") -
src/main/java/com/example/moviezone/repository/ProjectionIsPlayedInRoomRepository.java
r8d49568 r64ee7f4 4 4 import com.example.moviezone.model.manytomany.ProjectionIsPlayedInRoomId; 5 5 import org.springframework.data.jpa.repository.JpaRepository; 6 import org.springframework.data.jpa.repository.Query; 7 import org.springframework.data.repository.query.Param; 6 8 7 9 import java.util.List; 8 10 9 11 public 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); 11 14 } -
src/main/java/com/example/moviezone/repository/SeatRepository.java
r8d49568 r64ee7f4 10 10 @Repository 11 11 public interface SeatRepository extends JpaRepository<Seat,Integer> { 12 List<Seat> findAllByProjection _room(Projection_Room projection_room);12 List<Seat> findAllByProjection(Projection_Room projection); 13 13 } -
src/main/java/com/example/moviezone/service/Impl/ProjectionIsPlayedInRoomServiceImpl.java
r8d49568 r64ee7f4 1 1 package com.example.moviezone.service.Impl; 2 2 3 import com.example.moviezone.model.manytomany.ProjectionIsPlayedInRoom; 3 4 import com.example.moviezone.repository.ProjectionIsPlayedInRoomRepository; 4 5 import com.example.moviezone.service.ProjectionIsPlayedInRoomService; 5 6 import org.springframework.stereotype.Service; 7 8 import java.util.List; 9 import java.util.Optional; 6 10 7 11 @Service … … 13 17 } 14 18 19 @Override 20 public List<ProjectionIsPlayedInRoom> getProjectionPlayedInRoom(Integer id) { 21 return projectionIsPlayedInRoomRepository.findAllByProjectionId(id); 22 } 15 23 } -
src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java
r8d49568 r64ee7f4 24 24 @Override 25 25 public List<Seat> findAllByProjection_Room(Projection_Room projection_room) { 26 return seatRepository.findAllByProjection _room(projection_room);26 return seatRepository.findAllByProjection(projection_room); 27 27 } 28 28 } -
src/main/java/com/example/moviezone/service/ProjectionIsPlayedInRoomService.java
r8d49568 r64ee7f4 1 1 package com.example.moviezone.service; 2 2 3 import com.example.moviezone.model.Film; 4 import com.example.moviezone.model.manytomany.ProjectionIsPlayedInRoom; 5 6 import java.util.List; 7 import java.util.Optional; 8 3 9 public interface ProjectionIsPlayedInRoomService { 4 10 List<ProjectionIsPlayedInRoom> getProjectionPlayedInRoom(Integer id); 5 11 6 12 } -
src/main/java/com/example/moviezone/web/HomeController.java
r8d49568 r64ee7f4 36 36 private final CinemaOrganizesEventService cinemaOrganizesEventService; 37 37 private 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 38 private 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) { 43 42 this.filmService = filmService; 44 43 this.userService = userService; … … 51 50 this.cinemaOrganizesEventService = cinemaOrganizesEventService; 52 51 this.cinemaPlaysFilmService = cinemaPlaysFilmService; 53 this.projectionIsPlayedInRoom Repository = projectionIsPlayedInRoomRepository;52 this.projectionIsPlayedInRoomService = projectionIsPlayedInRoomService; 54 53 } 55 54 … … 285 284 286 285 287 List<ProjectionIsPlayedInRoom> p= projectionIsPlayedInRoom Repository.findAllById_projection(id_projection);286 List<ProjectionIsPlayedInRoom> p= projectionIsPlayedInRoomService.getProjectionPlayedInRoom(id_projection); 288 287 289 288 model.addAttribute("projection",projection);
Note:
See TracChangeset
for help on using the changeset viewer.