0

在网上多次搜索后,我找不到适合我的案例的解决方案

我有一个包含几列的表格,我想在一些列中进行更新

@NamedQueries({
@NamedQuery(name = "Utilizador.updateNormal", query="UPDATE Utilizador u SET u.nome = :nome AND u.morada = :morada AND u.grupoPro = :grupoPro AND u.username = :username AND u.email = :email AND u.telemovel = :telemovel WHERE u.id = :id"),
@NamedQuery(name = "Utilizador.findAll", query = "SELECT u FROM Utilizador u"),

我不想使用 Utilizador.updateNormal 但给我一个

Exception Description: Syntax error parsing the query [Utilizador.updateNormal: UPDATE Utilizador u SET u.nome = :nome AND u.morada = :morada AND u.grupoPro = :grupoPro AND u.username = :username AND u.email = :email AND u.telemovel = :telemovel WHERE u.id = :id], line 1, column 39: syntax error at [AND].

我花了很多时间在网上寻找解决方案,但在我的情况下没有任何效果

请帮忙

4

1 回答 1

0

不要使用AND. 使用逗号。

@NamedQuery(name = "Utilizador.updateNormal", query="UPDATE Utilizador u SET u.nome = :nome, u.morada = :morada, u.grupoPro = :grupoPro, u.username = :username, u.email = :email, u.telemovel = :telemovel WHERE u.id = :id"),
于 2013-05-01T05:49:09.300 回答