title: Workarounds for Hibernate's lack of delete-orphan support for one-to-one and many-to-one relationships?
body: <p>Hibernate has no support for "delete-orphan" cascading of one-to-one or many-to-one relationships.  I recently discovered this, and it's giving me a serious headache.  I have a couple classes in my model that were designed such that the child has no real world meaning outside of the parent.  I only have one DAO for the parent, and not a separate DAO for the child class.</p>
  
  <p>This works:</p>
  
  <pre><code>parent.getChild().setProperty("something");
  parentDao.save(parent);
  </code></pre>
  
  <p>This doesn't do anything:</p>
  
  <pre><code>parent.setChild(null);
  parentDao.save(parent);
  </code></pre>
  
  <p>This is highly unfortunate because now I have to rethink my DAO layer and a few of the operations of my service layer. </p>
  
  <p>Has anyone worked around this limitation in an elegant way?  I'd really like to only concern myself with persisting parent objects.  In this particular case, there is no reason to deal with child persistence except to make Hibernate happy, and only in the case of deleting children.</p>