Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以使用休眠限制(我的意思是 ids 130、146、147、148)从表中获取在指定时间(例如上午 9 点)创建的项目吗?
你能告诉我如何(在JavacreateDate中的Calendar格式)?
createDate
Calendar
是否必须使用限制来完成?不能用别的吗?如果是,那么您应该可以使用以下方法进行操作:
Restrictions.sqlRestriction("DATEPART(hour,createDate) = 09")
不确定 09 中的 0,也没有自己测试,但不明白为什么它不应该工作。