我安排了一个webjob每天凌晨2点运行,使用cron表达式(0 0 2***)按照使用CRON表达式创建预定WebJob的教程 ,我的服务器在"美国中北部"区域创建,所以我希望它应该在美国中部时区运行但似乎它运行的时间与我指定的时间不同.
我有以下SQL查询,我需要使它在HQL中工作,我尝试了几个解决方案,但没有一个工作.(数据库:SQL服务器)
select t.createdTimeStamp FROM ServiceData t , UserInfo C where C.UserId = t.UserId and CAST(t.createdTimeStamp AS DATE) = '2016-05-30'
Run Code Online (Sandbox Code Playgroud)
我尝试在HQL中使用但没有工作,(createdTimeStamp是sql server中的datetime数据类型)
查询:
select t.createdTimeStamp FROM ServiceData t , UserInfo C where C.UserId = t.UserId and CAST(t.createdTimeStamp AS DATE) = '2016-05-30'
Run Code Online (Sandbox Code Playgroud)
错误:
org.hibernate.QueryException: Could not resolve requested type for CAST : DATE
Run Code Online (Sandbox Code Playgroud)
任何有关如何使其发挥作用的建议都会有所帮助.