Hi Kevin, Yes. This is the problem with MySQL not being able to initially defer the constraints. If you need to use MySQL, I suggest that you remove the Foreign Key constraint between STUDENT and PERSON in the database and trust that EOF will keep everything correct for you.
I would also suggest that you avoid using Vertical Inheritance if you can. It is very inefficient when creating select statements in the database. It does make the database more normalized, but at the cost of efficiency. In this situation I would use Single Table Inheritance instead. Dave On Dec 21, 2009, at 3:56 AM, Kevin Xiaowen REN wrote: > > Hi, All > > I know this is old topic, but I found something this time when try to play > this "vertical inheritance" with Apple/example/SophisticatedDatabaseExample > > Copied from README: > The SophisticatedDatabaseExample demonstrates the use of inheritance, > flattening, and multiple models. > The Person class is abstract. Student, Parent and Employee inherit from > Person using horizontal inheritance. > The Admin,Staff, Teacher classes all inherit from Employee using > single-table inheritance. > The HomeAddress, WorkAddress, and BillingAddress inherit from Address using > vertical inheritance. > > I turn on the log, because the application is working randomly. Attached is > working and not working part log file. > > When it's working, EOF generated the the right sequence table name for > insert sql like address, home_addres then student. > > When it's not working, EOF generated sql is wrong sequence , try to insert > STUDENT first and broken, because no address and home_address in database. > > I found there was a bug fixed report in WO5.4.1, No 5405227 , "Vertical > inheritance does not generate the right sequence table name", > > I am using WO 5.4.3, but not WOnder. Not sure this is the new bug, or not > fixed totally, > > Is any workaround solution? Or fix in WO , Wonder later? > > Is it an "INITIALLY DEFERRED DEFERRABLE" constraints issue in MySQL?but it's > working sometimes. > > > > Thanks > > <<saveChanges.txt>> > > > kevin > > Reading this email at work? Make a change with Yahoo!Xtra > Jobs<saveChanges.txt> _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com > > This email sent to [email protected] David Avendasora Senior Software Engineer K12, Inc. ***** WebObjects Documentation Wiki : http://wiki.objectstyle.org/confluence/display/WO/ ***** WebObjects API: http://developer.apple.com/legacy/mac/library/documentation/MacOSXServer/Reference/WO54_Reference/index.html *****
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
