我是靠谱客的博主 老迟到小鸽子,这篇文章主要介绍hibernate时间查询,现在分享给大家,希望可以做个参考。


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时间查询内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(146)

评论列表共有 0 条评论

立即
投稿
返回
顶部