2

我想删除项目列表,并为实体电子邮件定义了以下查询:

@NamedQuery(name = Email.namedQueryDeleteOldEmails, query = "DELETE FROM Email e where e.creationDate <= :creationDate")

当我执行它时,出现以下错误:2012-10-26 12:45:25,570 ERROR [SGVISTA] org.hibernate.hql.internal.ast.ErrorCounter - line 1:1: unexpected token: Email line 1:1 :意外令牌:电子邮件

有人知道我的查询有什么问题吗?非常感谢

4

1 回答 1

0

@NamedQuery(name ="Email.namedQueryDeleteOldEmails", query = "DELETE FROM Email e where e.creationDate <= :creationDate")

在双引号内使用命名的名称它将起作用

于 2013-03-11T08:43:22.733 回答