title: JPA's cascade = REMOVE and Hibernate's @OnDelete used together?
body: <p>I have inherited a code base on which nearly all relations have the following annotations:</p>
  
  <pre><code>@OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.REMOVE }, mappedBy = "someThing")
  @OnDelete(action = OnDeleteAction.CASCADE)
  </code></pre>
  
  <p>Now I'm having trouble understanding what <code>@OnDelete</code> does in the first place. <a href="https://stackoverflow.com/questions/7948297/hibernate-ondelete-vs-cascade-cascadetype-remove">Hibernate: OnDelete vs cascade=CascadeType.REMOVE</a> is interesting, but unfortunately doesn't have any answers and the JavaDoc for <code>@OnDelete</code> is particularly worthless.</p>
  
  <p>From the other questions it looks like the OnDelete annotation somehow lets the DB do the cascading, while the cascading directive on <code>@OneToMany</code> let's the ORM do it, but what would ever be the purpose of using them together?</p>
  
  <p>And does <code>@OneToMany</code>'s cascade directive really doesn't allow the ORM implementation to generate a DB based cascade anyway?</p>