Hi, I have a similar problem. I also noticed that Hibernate doesn't add ON CASCADE to the DDL, but it seems common behavior with other ORMs as well.. it is as if hibernate doesn't "rely" on the fact that the underlying db provides FKs, and chooses to manage it on his own. In my case, I've noticed that a call to:
Code:
entitymanager.remove(parent);
works great, removes all children, etc.
But a query that does the same, i.e.
Code:
delete from Parent p where parentId = 6
causes the exception. Seems like Hibernate doesn't "want" to utilize its relationship knowledge during the DELETE query...
any suggestions? I'm stuck on this one as well...
I'm using Hib 3.2.6 GA.