hibernate HQL 日期差异
我想查找映射到具有以下条件的对象 XYZ 的所有记录 A 有日期字段 XyzDateTime (它是时间戳) 现在当前时间-xyzDateTime> 20 我要选择记录
query = session.creatQuery(Select x from XYZ where :currentTime-xyzDateTime > 20 )
query.setParameter("currentTime",new Date())
这是正确的吗?
我可以通过这种方式检查日期差异吗?
I want to find all records which maps to object XYZ with following conditions
A has date field XyzDateTime (its a time stamp)
Now currentTime -xyzDateTime > 20 i want to select the record
query = session.creatQuery(Select x from XYZ where :currentTime-xyzDateTime > 20 )
query.setParameter("currentTime",new Date())
is this correct?
Can i check date difference in this way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是不正确的。最简单的解决方案就是这样(根本不是最漂亮的解决方案)
It's not correct. Simplest solution is like that (not the prettiest solution at all)