parameters except Pageable and Sort type once, or none at all"/>
Either use @Param on all parameters except Pageable and Sort type once, or none at all
Spring Data Jpa在使用是出现错误
java.lang.IllegalArgumentException:Either use @Param on all parameters except Pageable and Sort typed once, or none at all
@Modifying
@Transactional
@Query("update Post set views = views + :increment where id = :id")
void updateViews(long id, @Param("increment") int increment);
少加了个@Param
改为
@Modifying
@Transactional
@Query("update Post set views = views + :increment where id = :id")
void updateViews(@Param("id")long id, @Param("increment") int increment);
更多推荐
Either use @Param on all parameters except Pageable and Sort type once, or none
发布评论