Save order of EO objects to support database foreign key constraints.
Save order of EO objects to support database foreign key constraints.
- Subject: Save order of EO objects to support database foreign key constraints.
- From: Steve Peery <email@hidden>
- Date: Thu, 25 May 2017 10:54:35 -0400
Hey List,
I am importing a bunch of relational data into a project and when I try to save changes I get an error something like this:
Error when attempting to save data: EvaluateExpression failed: : Next exception:SQL State:23000 -- error code: 1452 -- msg: Cannot add or update a child row: a foreign key constraint fails (`valueA`.`valueB`, CONSTRAINT `TableA_tableBID_id_FK` FOREIGN KEY (`tableBID`) REFERENCES `tableB` (`id`))
I know it is because they are not written to the database in the order created. I have dealt with this in the past by doing incremental saving and other awkward things, but in this case that would be a total pain.
Any suggestions for the best way to deal with this?
Thank you,
Steve Peery
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden