Update table for only changed fields
<p>I have a person table and Person.java which maps to the table. I have an edit ui to change details of a Person record. On the edit page user normally changes 1 or 2 fields at a time. I am using AJAX to send the update call and want to only send the fields which are changed. Currently sending the whole object back.</p>

<p>The problem is at the backend about how to update database for only the changed fields.</p>

<p>The UI layer creates a Person object with only the changed fields and rest of the fields will be uninitialized. The object is then passed to DAO for persistence. How the DAO would know what fields are changed? What fields are uninitialized or deliberately set to null for update. Currently the whole object comes so I update all the columns.</p>
