title: How to only update JSON defined properties in hibernate
body: <p>I'm creating a SpringBoot/Angular 8 Application and am having some issues when attempting to update the decoupled frontend/backend objects. When I send a json post request containing the angular model, the <code>@JsonIgnore</code>'d or otherwise missing values are updated to null instead of being ignored.</p>
  
  <h2>Related Issue:</h2>
  
  <p>This stack overflow question is closely related, and the recommended solution does work, but it breaks/bypasses a bunch of the Jackson/Hibernate annotations (e.g. <code>@Inheritance(strategy=InheritanceType.JOINED)</code> and <code>@Transient</code>), so I would like to look for alternative solutions if possible:
  <a href="https://stackoverflow.com/questions/27578395/hibernate-partially-update-when-entity-parsed-with-json">hibernate partially update when entity parsed with json</a></p>
  
  <h2>Example Java POJO</h2>
  
  <pre><code>@Entity
  @Table(name = "users")
  @DynamicUpdate
  public class User implements Serializable{
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      @Column
      private String a;
  
      @Column
      private String b;
  
      @Column (nullable = false)
      @JsonIgnore
      private String c;
  
     // standard getters and setters
  }
  </code></pre>
  
  <h2>Example Java Rest API</h2>
  
  <pre><code>@RequestMapping(value = "/api/user", method = RequestMethod.POST)
  public @ResponseBody ResponseEntity&lt;User&gt; saveOrUpdate(@RequestBody User user, BindingResult result, HttpServletRequest request) {
      if(user.getId()!=null){
          user=ws.update(user);
      }else{
          user=us.create(user);
      }
      return new ResponseEntity&lt;&gt;(user,HttpStatus.OK);
  }
  
  </code></pre>
  
  <h2>Example Angular Service Method</h2>
  
  <pre><code>saveUser(user:User): Observable&lt;User&gt;{
      const body = JSON.stringify(user);
      return this.http.post&lt;User&gt;('/api/user', body).pipe(map( response =&gt; response));
  }
  </code></pre>
  
  <h2>Existing Database model:</h2>
  
  <pre><code>{ 
    id:1,
    a:"some value a"
    b:"some value b"
    c:"some value c"
  }
  </code></pre>
  
  <h2>Angular Post Body:</h2>
  
  <pre><code>{ 
    id:1,
    a:"some value a2"
    b:"some value b2"
  }
  </code></pre>
  
  <h2>Expected Hibernate Query:</h2>
  
  <p><code>update users set a=?,b=? where id=?</code></p>
  
  <h2>Actual Hibernate Query:</h2>
  
  <p><code>update users set a=?,b=?,c=? where id=?</code>
  C, in this case, is a null value. </p>