@Entity
@NamedQuery(name = "DayTotalPeople.updateTotal", query = "update DayTotalPeople d set d.totalPeople =?1 where d.date =?2 AND d.venue =?3")
public class DayTotalPeople {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
private LocalDate date;
private Integer totalPeople;
@ManyToOne
@JoinColumn(name = "venue_id")
@JsonBackReference
private Venue venue;
public DayTotalPeople() {}
public DayTotalPeople(LocalDate date, Integer totalPeople, Venue venue) {
this.date = date;
this.totalPeople = totalPeople;
this.venue = venue;
}
//getters & setters
}
但是,当我为该类添加另一个命名查询时,如下所示,当我尝试在localhost和AWS上访问该应用程序时,我得到404。
@Entity
@NamedQueries({
@NamedQuery(name = "DayTotalPeople.updateTotal", query = "update DayTotalPeople d set d.totalPeople =?1 where d.date =?2 AND d.venue =?3"),
@NamedQuery(name = "DayTotalPeople.findSumPeopleByVenueAndDateBetween", query = "select sum(d.totalpeople) from DayTotalPeople d where d.venue=?1 and d.date between ?2 and ?3")
})
public class DayTotalPeople {
.....
我根本不明白这是怎么回事。任何人都可以解释为什么我甚至无法访问主页由于上述原因?谢谢!