I have two related clases JPA-annotated. Alarm and Status. One Alarm can have one Status.
What I need is to be able to delete one Status and \"propagate\" a null v
Just add that using the Hibernate annotation:
@OnDelete(action=OnDeleteAction.CASCADE)
generates the foreign key as : "ON UPDATE NO ACTION ON DELETE CASCADE;"
But there is no action=OnDeleteAction.SET_NULL
Moreover, I don't like to tie my code to Hibernate if possible (but I can live with it if it works).
This thread discusses it. I can't believe there is not an easy method in JPA (or Hibernate extensions) to generate the foreign key.