View Single Post
  #2 (permalink)  
Old 06-12-2007, 04:37 PM
Peter Peter is offline
Senior Member
 
Join Date: Jun 2007
Posts: 119
Peter is on a distinguished road
Your problem isn't Hibernate, but the definition of the tables:
Check this:
Here, you define the primary key of the nuser and it is 2 columns

notification_id and nuser_id
Code:
CREATE TABLE `nuser` ( [...] PRIMARY KEY (`notification_id`,`nuser_id`), )
But, here you tell it, to does a reference to a nuser table, only with the column notification_id
Code:
CREATE TABLE `nuseractions` ( CONSTRAINT `nuseractions_fk` FOREIGN KEY (`notification_id`) REFERENCES `nuser` (`notification_id`) ON DELETE CASCADE ON UPDATE CASCADE,
But nuser has a primary key with 2 columns, so it's incorrect.
check it, and fix it
Reply With Quote