title: Hibernate set foreign key to null when delete entity
body: <p>I have following hibernate entites:</p>
  
  <pre><code>@Entity
  @Table(name = "model_view")
  public class ModelView {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "modelView_id")
      private Integer id;
  
      @ManyToOne
      @NotNull
      @JoinColumn(name = "page_id", nullable = false, insertable = true, updatable = true)
      private Page page;
  
      /* getters and setters */
  }
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>@Entity
  public class Page {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "page_id")
      private Integer id;
  
      @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
      @JoinColumn(name = "page_id")
      @IndexColumn(name = "modelView_id")
      private Set&lt;ModelView&gt; modelViews = new HashSet&lt;ModelView&gt;();
  
      /* getters and setters */
  }
  </code></pre>
  
  <p>When I delete entity «ModelView» in DAO I have exception:</p>
  
  <pre><code>ORA-01407: unable to replace ("MODEL_VIEW"."PAGE_ID") to NULL
  </code></pre>
  
  <p>What is wrong? Why hibernate set foreign key to NULL before delete?</p>