HQL中的时间比较

 

String hql = "from TradeRecord as tr where tr.TradeTime>= :startTime "
+ "and tr.TradeTime <= :endTime and tr.CustomerId =:cid";
String[] params = { "startTime", "endTime", "cid" };
Object[] args = { startTime, endTime, new Long(cid) };
List list = this.getHibernateTemplate().findByNamedParam(hql, params, args);

startTime,endTime,cid是这个方法的参数

 

你可能感兴趣的:(string,list,object)