mysql - Hibernate doesn't generate cascade -


I set a set hibernate.hbm2ddl.auto to create tables in that hibernate mysql for me.

However, it does not seem that the hibernate connects correctly to the references in the table Cascade This also works when I delete a line for example And I have a discount cascade in the form of hibernate annotations I think that means that it means that the hibernate reads the annoation on the order, and manifests itself broadly

Is that normal behavior

For example?

  @ Entity class report {@OneToOne (public place) = CascadeType.ALL) public file getPdf () {return pdf; }}  

Here I have set a waterfall to everyone. However, when is running, create a table report

  Report | CREATE TABLE `Report` (` id` bigint (20) No NULL AUTO_INCREMENT, `pdf_id` bigint (20) Default zero, primary key (` id`), key `FK91B14154FDE6543A` (` pdf_id`), constraint `FK91B14154FDE6543A` overseas Key (`pdf_id`) reference` file` (`id`)) ENGINE = InnoDB DEFAULT CHARSET = utf8 |  

It does not say anything about the other foreign key in my opinion, it must be added to delete the DELETE update on the CASCADE current

< / Div>

itemprop = "text">

CascadeType and @Cascade definitions are not translated into DDL, they say how to behave when hibernate is done when an operation is done.

However, it is that you can use the parent to use the foreign key to make it suitable on the deleted cascade section.


Comments