Jersey: Best practice handling restful HTTP PUT (update) request
<p>Suppose I have very simple <code>User</code> class:</p>

<pre><code>@JsonIgnoreProperties({"password", "created", "lastModified"})
public class User {
    public String id;
    public String name;
    public String password
    public Long created;
    public Long lastModified;
}
</code></pre>

<p>When we serialize a <code>User</code> entity to JSON string, we filter out <code>password</code>, <code>created</code> and <code>lastModified</code>. And then user at the front end will update the user's name and put the user back to our Restful service.</p>

<p>And my pseudo controller method handling the <code>PUT</code> request:</p>

<pre><code>@Path("/user/{id}")
@POST
@Consumes(MediaType.APPLICATION_JSON)
public void saveUpdate(@PathParam("id")String id, User user) {
    userService.save(user);
}
</code></pre>

<p>In the above method I expect Jackson will deserialize the JSON string sent by front end to the POJO <code>user</code> instance, and then call our service to save the instance.</p>

<p>So far everything looks cool. However the concern raised when we pass the <code>user</code> POJO to <code>userService</code> to save it. Remember we have three properties ignored when we serizalize the <code>user</code> into JSON: <code>password</code>, <code>created</code>, <code>lastModified</code>, and we have to get the value of those missing properties from database and then merge with the data sent through from front end.</p>

<p>Doing the merge operation is a very simple but tedious task for coder. I was wondering if there is any good practices to handle this case in an easy and elegant way</p>