Spring REST partial update with @PATCH method

后端 未结 4 2052
感动是毒
感动是毒 2021-01-31 12:47

I\'m trying to implement a partial update of the Manager entity based in the following:

Entity

public class Manager {
    private int id;
    private Str         


        
4条回答
  •  感动是毒
    2021-01-31 13:07

    First, you need to know if you are doing an insert or an update. Insert is straightforward. On update, use get() to retrieve the entity. Then update whatever fields. At the end of the transaction, Hibernate will flush the changes and commit.

提交回复
热议问题