-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Add index/constraint issue after mySQL import DB generation
PostPosted: Thu Jul 02, 2009 6:53 am 
Newbie

Joined: Sun Mar 27, 2005 1:22 pm
Posts: 15
Hi,

I have a bit of a problem with the constraints in my database and how hibernate manages them asd would appreciate andy help or just a place to go to find the solution, thanks. This is how I got to the problem..

1. created schema with hibernate
2. added data in to schema
3. need to export partial tables from DB as they contain the importatnt data
4. import the export into new database
5. Let hibernate create remaining tables on new database.
6. Errors

These are the errors,

Code:
11:35:08,316 DEBUG SchemaUpdate:149 - alter table jforum_groups add index FK80BB241C6B459AD9 (parent_id), add constraint FK80BB241C6B459AD9 foreign key (parent_id) references jforum_groups (group_id)
11:35:08,394 DEBUG NewPooledConnection:430 - com.mchange.v2.c3p0.impl.NewPooledConnection@1a95a1d handling a throwable.
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`football/#sql-580_2be`, CONSTRAINT `FK80BB241C6B459AD9` FOREIGN KEY (`parent_id`) REFERENCES `jforum_groups` (`group_id`))

11:35:08,441 ERROR SchemaUpdate:155 - Unsuccessful: alter table jforum_groups add index FK80BB241C6B459AD9 (parent_id), add constraint FK80BB241C6B459AD9 foreign key (parent_id) references jforum_groups (group_id)
11:35:08,441 ERROR SchemaUpdate:156 - Cannot add or update a child row: a foreign key constraint fails (`football/#sql-580_2be`, CONSTRAINT `FK80BB241C6B459AD9` FOREIGN KEY (`parent_id`) REFERENCES `jforum_groups` (`group_id`))




I think that hibernate wants to add indexes to the tables that I created from the import. Also the import script had constraints named in them and I believe that they may be conflicting as hibernate would no longer use those names.
Any help would be greatfully apreciated.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.