lm121342074 2017-03-31 01:28 采纳率: 7.1%
浏览 865

获取时间段内的数据hql语句报错,怎么回事,求解答!!!

2017-3-28 15:24:21

Tue Mar 14 00:00:00 CST 2017

from AySupervise a where a.hostDate between Tue Mar 14 00:00:00 CST 2017 and Sat Mar 18 00:00:00 CST 2017 and a.personId = ? order by a.hostDate desc

第一个是hostDate时间日期格式,第二个是从页面获取到的字符串时间,我自己转化成日期格式,第三个是hql语句,下面是报的错
org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: Mar near line 1, column 77 [from com.sysway.supervise.entity.AySupervise a where a.hostDate between Tue Mar 14 00:00:00 CST 2017 and Sat Mar 18 00:00:00 CST 2017 and a.personId = ? order by a.hostDate desc ]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: Mar near line 1, column 77 [from com.sysway.supervise.entity.AySupervise a where a.hostDate between Tue Mar 14 00:00:00 CST 2017 and Sat Mar 18 00:00:00 CST 2017 and a.personId = ? order by a.hostDate desc ]

  • 写回答

1条回答 默认 最新

  • 我是1只猫 2017-03-31 02:06
    关注

    你数据库的时间字段是时间格式还是字符串格式,还有你的时间格式引的是java util 还是sql的?

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog