您好我有以下查询:
String hql = "UPDATE Raumreservierung as rr " +
"set VON = :begin " +
"where VON = :Von " +
"and Raum_ID IN (SELECT r.ID FROM Raum r " +
"inner join r.Panel as pl with pl.ID = " + clientId + "";
IQuery query = CurrentSession.CreateQuery(hql);
query.SetParameter("begin", DateTime.Now);
query.SetParameter("Von", v.Von);
int result = query.ExecuteUpdate();
查询对“VON”进行更新。这工作正常,但查询的其余部分不起作用。似乎查询的其余部分无法正常工作。但没有得到任何错误。
对于查询的其余部分,我指的是查询的以下部分:
"and Raum_ID IN (SELECT r.ID FROM Raum r " +
"inner join r.Panel as pl with pl.ID = " + clientId + "";
因为它应该仅在“VON”列上发生更新,例如当“clientId”为“AT2”时 但那部分不起作用。因为更新也发生在其他clientId上。
答案 0 :(得分:2)
你忘了关上你的括号。
(另外,你也应该使用clientId的参数)