Playframework 播放框架-Sql查询返回0结果

Playframework 播放框架-Sql查询返回0结果,playframework,playframework-2.3,ebean,Playframework,Playframework 2.3,Ebean,这是我编写的用于连接各种表并返回列表的查询。这在我的电脑上非常有效,但如果我在不同的PC/笔记本电脑上尝试,它总是返回0结果。让我知道我做错了什么 感谢问题在于表单中的绑定值NULL,因此NULL值作为一个参数传递,结果为0。要解决绑定值问题,我所做的只是: 活化剂清洗 激活器编译 激活器运行 public static List<SqlRow> findQuery(int page , int index, String source , String destination ,

这是我编写的用于连接各种表并返回列表的查询。这在我的电脑上非常有效,但如果我在不同的PC/笔记本电脑上尝试,它总是返回0结果。让我知道我做错了什么


感谢

问题在于表单中的绑定值NULL,因此NULL值作为一个参数传递,结果为0。要解决绑定值问题,我所做的只是:

活化剂清洗

激活器编译

激活器运行

public static List<SqlRow> findQuery(int page , int index, String source , String destination , Date date) {



    String sql = "select DISTINCT airplane.id,airplane.reg_no,airplane.type,airplane.total_seat,source,destination,depart_date,amount from airplane,routee,flight,fare,airport ,flight_airplane   where airplane.id IN  (select AIRPLANE_ID  from FLIGHT_AIRPLANE where FLIGHT_ID IN (select id from flight where depart_date= :date \n" +
            "AND ROUTEE_ID IN (select id from routee where source= :first and destination= :destination and airport_id IN (select id from airport where CITY= :first OR COUNTRY= :first) AND fare_id IN (select id from fare) ))\n" +
            ") and source= :first  and destination= :destination and depart_date= :date order by amount   ;";

    SqlQuery sqlQuery = Ebean.createSqlQuery(sql);
    sqlQuery.setParameter("first",source);
    sqlQuery.setParameter("destination",destination);
    sqlQuery.setParameter("date",date);

    return  sqlQuery.findList();

}