我正在尝试使用 Spring Boot JPA 从 MySQL 表中检索所有记录。以下是存储库定义
MovieRepository 类
@Query("From MovieEntity m, TheaterMovieShowEntity tms, TheaterEntity t where t.city=?1 and t.theaterid=tms.theaterid and m.movieid=tms.movieid and t.seatsavailable>=?2")
List<Movie> getMoviesDetails(String cityName, int noOfTickets)throws MovieException;
电影服务类
public List<Movie> getMoviesDetails(String cityName, int noOfTickets)throws MovieException{
List<Movie>moviesIntheCityList = new ArrayList<Movie>();
**moviesIntheCityList = (List<Movie>) movieRepository.getMoviesDetails(cityName, noOfTickets);**
System.out.println("in the getMoviesDetails after querying"+moviesIntheCityList); // This is null
return moviesIntheCityList;
}
我错过了什么?