title: Bulk deletes/updates in hibernate: best approach?
body: <p>I know in hibernate (or even in JPA?) bulk delete operations are not cascaded to related entities. </p>
  
  <p>Let's assume you have following entities A, B and C.<br>
  B has a ManyToOne relationship with A but this is not inverted (so A does not have a list of B's).<br>
  C has a ManyToOne relationship with B but also this is not inverted (so B does not have a list of C's).</p>
  
  <p>Now, if an A gets deleted then I want all B's referencing this A to be deleted and all C's referencing these B's to be deleted as well. Since there is no cascading I need to propagate these deletes myself. So the question is what would be the best approach to go about this:  </p>
  
  <ol>
  <li>sql (delete from C where b_id IN (select is from B where a_id in (select id from A ...</li>
  <li>using hibernate: load all C's for A and then delete those entities and then load all B's for A and delete those; finally delete A</li>
  <li>???</li>
  </ol>