@Modifying
@Query("update User u set u.firstname = ?1 where u.lastname = ?2")int setFixedFirstnameFor(String firstname, String lastname);
spring mvc 中update 需要这么写:
@Modifying
@Query("update Video set delFlag='" + Video.DEL_FLAG_NORMAL + "',type.id= ?1, uploadDate= ?2 where id= ?3")
public int updateTypes(long fId,Timestamp uploadDate,long id) ;