title: Hazelcast map synchronization
body: <p>I am trying to implement distributed cache using Hazelcast in my application. I am using Hazelcast’s <code>IMap</code>. The problem I have is every time I get a value from a map and update the value, I need to do a <code>put(key, value)</code> again. If my value object has 10 properties and I have to update all 10, then I have to call <code>put(key, value)</code> 10 times. Something like - </p>
  
  <pre><code>IMap&lt;Integer, Employee&gt; mapEmployees = hz.getMap("employees");
  Employee emp1 = mapEmployees.get(100);
  emp1.setAge(30);
  mapEmployees.put(100, emp1);
  emp1.setSex(“F”);
  mapEmployees.put(100, emp1);
  emp1.setSalary(5000);
  mapEmployees.put(100, emp1);
  </code></pre>
  
  <p>If I don’t do this way, some other node which operates on the same Employee object will update it and the final result is that the employee object is not synchronized. Is there any solution to avoid calling put explicitly multiple times? In a <code>ConcurrentHashMap</code>, I don’t need to do this because if I change the object, the map also gets updated.</p>