title: Trying to delete a record from a parent entity java class
body: <p>I have two entity java classes . Now I am trying to Delete a record from parent entity but it was throwing an error : <code>org.hsqldb.HsqlException: integrity constraint violation: foreign key no action; SYS_FK_10142 table: CHILD</code>.</p>
  
  <pre><code>**Parent class**
  @Entity
  @Table(name = "Parent")
  public class Parent
  {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @NotBlank
    @Column(name = "data")
    private String data;
    public Long getId()
    {
      return id;
    }
    public void setId(Long id)
    {
      this.id = id;
    }
  
    public String getData()
    {
      return data;
    }
  
    public void setData(String data)
    {
      this.data = data;
    }
  }
  
  **Child class**
  
  @Entity
  @Table(name = "Child")
  public class Child
  {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
  
    @NotBlank
    private String model;
  
    @ManyToOne()
    @OnDelete(action= org.hibernate.annotations.OnDeleteAction.CASCADE)
    private Parent parent;
  
    public Long getId()
    {
      return id;
    }
  
    public void setId(Long id)
    {
      this.id = id;
    }
  
    public String getModel()
    {
      return model;
    }
  
    public void setModel(String model)
    {
      this.model = model;
    }
  }
  </code></pre>