title: JPA Cascading Delete: Setting child FK to NULL on a NOT NULL column
body: <p>I have two tables: t_promo_program and t_promo_program_param.</p>
  
  <p>They are represented by the following JPA entities:</p>
  
  <pre><code>@Entity
  @Table(name = "t_promo_program")
  public class PromoProgram {
    @Id
    @Column(name = "promo_program_id")
    private Long id;
  
    @OneToMany(cascade = {CascadeType.REMOVE})
    @JoinColumn(name = "promo_program_id")
    private List&lt;PromoProgramParam&gt; params;
  }
  
  @Entity
  @Table(name = "t_promo_program_param") 
  public class PromoProgramParam {
    @Id
    @Column(name = "promo_program_param_id")
    private Long id;
  
    //@NotNull // This is a Hibernate annotation so that my test db gets created with the NOT NULL attribute, I'm not married to this annotation.
    @ManyToOne
    @JoinColumn(name = "PROMO_PROGRAM_ID", referencedColumnName = "promo_program_id")
    private PromoProgram promoProgram;
  }
  </code></pre>
  
  <p>When I delete a PromoProgram, Hibernate hits my database with:</p>
  
  <pre><code>update
      T_PROMO_PROGRAM_PARAM 
  set
      promo_program_id=null 
  where
      promo_program_id=?
  
  delete 
  from
      t_promo_program 
  where
      promo_program_id=? 
      and last_change=?
  </code></pre>
  
  <p>I'm at a loss for where to start looking for the source of the problem.</p>