Вот мой код:
airelines = em.createQuery(
"select distinct rt.aireline from Route as rt join rt.aireline as a1"
+ " join rt.destination as dst "
+ " where a1.country = :country and dst.city = :city ", Airline.class)
.setParameter("country", "France")
.setParameter("city", "Miami")
.getResultList();
showAirlines(airelines);
У меня есть эти ошибки. Пожалуйста, как можно устранить эти ошибки. С уважением.
Exception in thread "main" java.lang.IllegalArgumentException:
org.hibernate.QueryException: could not resolve property: aireline of: flights.Route [select distinct rt.aireline from flights.Route as rt join rt.aireline as a1 join rt.destination as dst where a1.country = :country and dst.city = :city ]
at
Вот мой класс Route:
@Entity
public class Route implements Serializable {
private String airlineCode;
@ManyToOne
@Id
private Airline airline;
private String sourceCode;
@ManyToOne
@Id
private Airport source;
private String destinationCode;
@ManyToOne
@Id
private Airport destination;
private Boolean codeshare;
private Short stops;
private String equipment;
//Getters and Setters
}
Большое спасибо. Пожалуйста, как можно устранить эти ошибки. С уважением.