Date date=Calendar.getInstance().getTime();
hql.append("From SMSSender s where 1=1 ")
.append(" and s.time != null ")
.append(" and s.time <=:date ");
Session session=smsSenderDao.getSession();
Query query=session.createQuery(hql.toString());
query.setTimestamp("date", date);//注意这里,用setTimestampe,不要用setDate
List<SMSSender> list=query.list();