SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -5);
String beginTime = sdf.format(cal.getTime());
String endTime = sdf.format(new Date());
String hql ="select lic from Licrequest lic,TWorkitem t where t.processInsId = lic.processInsId "
+"and t.description = 'A011' and lic.waitStatus is null "
+"and lic.createtime >= " +"to_date('" + beginTime + "', 'yyyy-MM-dd HH24:mi:ss')"
+"and lic.createtime <= " +"to_date('" + endTime + "', 'yyyy-MM-dd HH24:mi:ss')";
最后
以上就是老迟到小鸽子最近收集整理的关于hibernate时间查询的全部内容,更多相关hibernate时间查询内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复