티스토리 뷰

공부

[JPA] @Query update immediately

승가비 2022. 8. 10. 02:32
728x90
@Transactional
@Modifying(clearAutomatically = true)
@Query(
        value = "" +
                "UPDATE recommendation_history SET " +
                "request_count = request_count + 1, " +
                "updated_date_time = now() " +
                "WHERE email = :#{#response.email} ",
        nativeQuery = true
)
int increase(@Param("response") Response response);

https://stackoverflow.com/questions/17121620/spring-data-jpa-update-query-not-updating

 

Spring Data JPA Update @Query not updating?

I have an update query: @Modifying @Transactional @Query("UPDATE Admin SET firstname = :firstname, lastname = :lastname, login = :login, superAdmin = :superAdmin, preferenceAdmin = :preferenceAdmin,

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

[Java] e.printStackTrace -> String  (0) 2022.08.10
[github] actions permissions  (0) 2022.08.10
[pandas] for index, row in rche_df.iterrows():  (0) 2022.08.10
[JPA] CreationTimestamp & UpdateTimestamp  (0) 2022.08.10
[pandas] DataFrame  (0) 2022.08.10
댓글