I am using Spring data JPA now every-time I perform update or delete Spring data JPA does select before running actual query.
@Modifying
@Query("update Device d set d.latestDevice = ?1 where d.senderId = ?2")
@Transactional(readOnly = false)
int updateLatestDevice(Device newDevice, Integer senderId);
@Modifying
@Transactional(readOnly = false)
int deleteById(Integer deviceId);
I can not find an exact answer to this situation.