由于您使用的是Postgres,因此我将完全更改date():
return sessionFactory.getCurrentSession(). createQuery("FROM Weather WHERe city_id = :id AND date " + "BETWEEN current_date AND (current_date + (integer :days - 1))"). setInteger("id", city_id).setString("days", days).list();
参见http://www.postgresql.org/docs/8.2/static/functions-
datetime.html
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)