Update several Columns in one Hibernate Query?

前端 未结 3 2298
渐次进展
渐次进展 2021-02-19 08:01

i have the Following HQL:

String hql = \"UPDATE Buchung as b \" +
             \"set STORNO = :Storno \" +
             \"where ID = :BuchungID\";
3条回答
  •  悲哀的现实
    2021-02-19 08:24

    HQL is no different than SQL in this case. Just use comma to separate columns:

    String hql = "UPDATE Buchung as b set " +
              "STORNO = :Storno," +
              "NAME = :Name " +
               ......  
              "where ID = :BuchungID";
    

提交回复
热议问题