我无法执行此 HQL 命令:
String hql = "select t.ticketName, t.idTicket, d.jour from Ticket as t inner join DateTraitement as d on d.idTicket=t.idTicket where t.idTicket= 1";
Query query = getSession().createQuery(hql) ;
List<Abc> result = query.list();
我有这个错误:org.hibernate.QueryException:无法解析属性:idTicket:mmmodel.DateTraitement [从 mmmodel.DateTraitement 中选择 t.ticketName,t.idTicket,d.jour 作为 d,mmmodel.Ticket 作为 t where d。 idTicket = t.idTicket]
这是我的 DateTreatment 课程:
在此处输入代码
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id_date_traitement", unique = true, nullable = false)
private Integer idDateTrait;
@Column(name = "jour", length = 50)
private int jour;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_ticket")
private Ticket ticket;
public Integer getIdDateTrait() {
return idDateTrait;
}
public void setIdDateTrait(Integer idDateTrait) {
this.idDateTrait = idDateTrait;
}
public int getJour() {
return jour;
}
public void setJour(int jour) {
this.jour = jour;
}
public Ticket getTicket() {
return ticket;
}
public void setTicket(Ticket ticket) {
this.ticket = ticket;
}
}
我不知道我错过了什么。感谢您的帮助。