title: Implement "reverse" orphan removal with JPA
body: <p>I have an entity Address that is referenced by several other entities, for example:</p>
  <pre><code>@Entity
  class Office {
      @OneToOne
      private Address address;
  
      ...
  }
  
  @Entity
  class Home {
      @OneToOne
      private Address address;
  
      ...
  }
  </code></pre>
  <p>where</p>
  <pre><code>@Entity
  class Address {
      @Id
      private Long id;
      private String street;
      private String zipCode;
      
      ...
  }
  </code></pre>
  <p>The field referencing <code>Address</code> in the other entities is nullable, so I'd like that when, for example, <code>Office.address</code> is set to <code>null</code>, the referenced entity is removed from database.</p>
  <p>This is similar to how <code>orphanRemoval</code> works, but in my situation I need that the <em>parent</em> class (<code>Address</code>) instance is removed, instead of the <em>child</em>.</p>
  <p>Is there a way to achieve this using a declarative way, or shoul I manually remove the unreferenced <code>Address</code>es?</p>
  <p><strong>NOTES</strong></p>
  <ul>
  <li><p>a new address is created every time a new Office/Home/etc. is created. (There are no shared addresses referenced by other entities.)</p>
  </li>
  <li><p>I tried to apply orphanRemoval to <code>@OneToOne</code> annotation, but setting the <code>address</code> field to null doesn't trigger the (<code>Address</code>) entity to be removed from the database.</p>
  </li>
  <li><p>I already checked this answer: <a href="https://stackoverflow.com/a/31471415/1061499">https://stackoverflow.com/a/31471415/1061499</a>, but this is not applicable to my case. I can't include a cross reference in my <code>Address</code> class.</p>
  </li>
  </ul>