title: Hibernate OnDelete cascade in test doesn't work
body: <p>I have one-directional related entities:</p>
  
  <pre><code>@Entity
  public class Book {
      private String isbn;
  }
  
  @Entity
  private class Recommentation {
      @ManyToOne(optional = false, fetch = FetchType.LAZY)
      @JoinColumn(name = "book_id", nullable = false)
      @OnDelete(action = OnDeleteAction.CASCADE)
      private Book book;
  }
  </code></pre>
  
  <p>And the following test:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @DataJpaTest
  public class BookRepositoryTest {
  
      @Autowired
      private TestEntityManager testEntityManager;
  
      @Autowired
      private BookRepository bookRepository;
  
      @Test
      public void delete() {
          // given
          String isbn = "isbn-1";
          Book book = new Book();
          book.setIsbn(isbn);
          testEntityManager.persist(book);
  
  
          Recommendation recommendation = new Recommendation();
          recommendation.setBook(book);
          testEntityManager.persist(recommendation);
  
          // when
          bookRepository.deleteBookByIsbn(book.getIsbn());
  
          // then
          assertThat(testEntityManager.find(Book.class, book.getId())).isNull();
          assertThat(testEntityManager.find(Recommendation.class, recommendation.getId())).isNull();
      }
  
  }
  </code></pre>
  
  <p><code>@OnDelete(action = OnDeleteAction.CASCADE)</code> works perfectly well when this code is invoked not from test but in the test I get exception that recommendation isn't deleted by book.</p>
  
  <p>Also I try to get any info from sql logged for hibernate queries and I can't see any <code>delete</code> statements for this test.</p>
  
  <p>I don't want to use bidirectional linking for entities and just try to understand how to solve this concrete issue or debug it somehow. </p>