title: Making a protective copy of JPA Entity
body: <p>In my Spring application, I have code that reads in XML, then fetches for example an Organization entity via JPA and then updates the fields found in the XML to the Organization and returns the Organization.</p>
  
  <p>But with code like this:</p>
  
  <pre><code>Organization updated = mergeToOrganization(jaxbOrganizationPojo, originalOrganization);
  </code></pre>
  
  <p>I really feel like I should start the <code>mergeToOrganization</code> method by making a protective copy of <code>originalOrganization</code> instead of directly mutating it. Direct mutation leaves me feeling dirty. But alternatives to that seem to be sketchy reflection or loooong get/set boiler plate code.</p>
  
  <p>Ideas? Opinions?</p>