org.hibernate.QueryException: Space is not allowed after parameter prefix ':'

来源:互联网 发布:java调用第三方接口 编辑:程序博客网 时间:2024/05/22 14:50
spring mvc + Hibernate4x + maven 抛异常报错:
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.QueryException: Space is not allowed after parameter prefix ':' 

root cause

org.hibernate.QueryException: Space is not allowed after parameter prefix ':' 
解决-->引用占位符:的前后不允许有空格。
error:
...AND apply.startTime >=: startTime1 AND apply.endTime <=: endTime1 
correct:
AND apply.startTime >=:startTime1 AND apply.endTime <=:endTime1 

0 3