My Model is like this:
@Entity
@Table(name = \"user\")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private
At first I need to say the Patch solution by @Oliver Gierke is really great.
And In my previous project, my solution is:
1. Create a abstract class to implement JpaRepository, and implement save() function.
2. In the save function, get the entity from DB. It not exist, just save it. Otherwise, use reflection to get all NOT NULL fields from the updated entity, and set into entity from DB. (it is similar as you do, but I did it for all save function)