web app and the query is from CrudRepository. Now, whenever I update a record, the target record does not get updated, instead a new record is inserted. What could be problem and how can I fix it?
First fetch the record from the db. Then update the existing record with the newer record, maybe thru setters.
You Need Id and a generated value strategy for this id
Make sure there is a PUT method bound to your request
PUT or PATCH
Обсуждают сегодня