title: Deserialize doctrine entity with JMS Serializer
body: <p>I have seen some questions related on S.O but somehow the answers don't solve my problem.</p>
  
  <p>I'm using JMS Deserializer to serialize doctrine entity to store into a string. However, when I deserialize it, I run into the following issue:</p>
  
  <p>The field <strong>id</strong> is set to readonly (because it's supposed to be auto-generated), and thus upon deserializing it does not get set back to the entity. Without the id, entityManager->merge does not work. The obvious solution is to add a setId method to the entity so that it is set back on deserialization process. However, that just doesn't feel right because id is not supposed to be set...</p>