@Transactional
@Modifying(clearAutomatically = true)
@Query(value ="update doctor dd set dd.name=?1,dd.height=?2,dd.weight=?3 where dd.id=?4", nativeQuery=true)
int update(String name, BigDecimal height, BigDecimal weight, int id);
reference:
@Transactional Role: commit the transaction
@Modifying (clearAutomatically = to true ) function: automatically clear the data stored in the entity