I have a table defined as this:
@Entity
@Table
@Inheritance(strategy=InheritanceType.JOINED)
public class Table implements Serializable {
@Id
@GeneratedValue
private Long id;
...
}
Then I have an inherited table:
@Entity
@Table
public class SubTable extends Table {
...
}
Hibernate correctly creates two table in my Postgres database but it defines on-delete action between the two tables as "NO ACTION".
How can I define in Hibernate, that I want CASCADE action to be defined on delete? For example when I manually delete a row from table Table I want to automatically get the corresponding row in table SubTable to be deleted. When I try to delete a row from Table now, it returns me foreign key constraint violation error.