title: Deleted entity passed to persist exception
body: <p>I have this kind of entities:</p>
  
  <blockquote>
    <p>Document 
       | n ..
       to
         ..1 |
    DocumentType
       | 1 ..
       to
       .. n |
    PropertyType
       | 1 ..
       to
       .. n |
    DocumentProperty</p>
  </blockquote>
  
  <p>I simply try to remove a document like:
  entityManager.remove(document);</p>
  
  <p>but an error is firing:</p>
  
  <blockquote>
    <p>16:45:51,499 ERROR [[Seam Resource Servlet]] Servlet.service() for servlet Seam Resource Servlet threw exception
    javax.persistence.EntityNotFoundException: deleted entity passed to persist: [up.docstore.PropertyType#]</p>
  </blockquote>
  
  <p>The problem seems to come from here:</p>
  
  <pre><code>@OneToMany(mappedBy = "documentType", cascade = {CascadeType.ALL}, fetch = FetchType.EAGER)
  @ForeignKey(name = "FK_DOCUMENT_TYPE__PROPERTY_TYPE")
  @Sort(type = SortType.NATURAL)
  private SortedSet&lt;PropertyType&gt; propertyTypes = new TreeSet&lt;PropertyType&gt;();
  </code></pre>
  
  <p>If i remove CascadeType.PERSIST all it's working.
  But i need it there and also i need it EAGERLY.</p>
  
  <p>Does anyone know other solution?</p>
  
  <p><strong>Edit</strong>: removed DELETE_ORPHAN cascade, but still the same problem.</p>