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 ]