title: Bypass "Entity not found" error with JPA
body: <p>Sometimes it's quite difficult (or a performance problem) to clean delete all references to an entity.</p>
  
  <p>For example, I've got a Person object which has relationships to another Person objects.</p>
  
  <p>When I delete a Person, I don't want to delete this Person in all relations she can have simply because sometimes this Person object does not know where it is referenced. So, if I would like to clean delete all references, I must do extra sql work that can result in performance problem.</p>
  
  <p>In an ideal world, I would like to delete the Person object and when another Person do a reference to this Person (because it has its id in its relations), simply return null.</p>
  
  <p>The fact is JPA complains that </p>
  
  <pre><code>javax.persistence.EntityNotFoundException: No row with the given identifier exists
  </code></pre>
  
  <p>Is there a way to force JPA to return a null reference and not an exception in this case ?</p>