`
mydisk
  • 浏览: 11101 次
  • 性别: Icon_minigender_1
  • 来自: 西安
最近访客 更多访客>>
社区版块
存档分类
最新评论

Hibenate hql 中使用mysql函数DATE_SUB出错

阅读更多
String hql = "Update Threads set lastPost='"+ author + "' ," + "lasttime=DATE_SUB(lasttime,INTERVAL 1 YEAR)" + " where tid="+ tid;

不知道Hql语句写错没有,执行时出错!

org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: 1 near line 1, column 90 [Update com.prebbs.models.Threads set lastPost='hyy' ,lasttime=DATE_SUB(lasttime,INTERVAL 1 YEAR) where tid=48]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: 1 near line 1, column 90 [Update com.prebbs.models.Threads set lastPost='hyy' ,lasttime=DATE_SUB(lasttime,INTERVAL 1 YEAR) where tid=48]
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics