I implemented soft delete using @SQLDelete(sql="UPDATE table_name SET deleted = true WHERE id = ?")
and it works fine. But how to update ‘updated_by’ and ‘updated_date’. I can update ‘updated_date’ by inserting for example updated_date = now()
into above query but how to update ‘updated_by’ for which I need user id that i get using SecurityContextHolder.
I try to use @PreRemove event but even though entity is updated the changes are not persisted.