Entity Modeller == EOModeler?
Entity Modeller == EOModeler?
- Subject: Entity Modeller == EOModeler?
- From: "Ren, Kevin" <email@hidden>
- Date: Thu, 19 Jun 2008 14:33:48 +1200
- Thread-topic: Entity Modeller == EOModeler?
Title: Entity Modeller == EOModeler?
Hi,
My question is coming from "SQL generation" in Entity Modeler.
When I am playing the code 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.
The relationship between Student and ScheduledCourse is an example of a many-to-many "flattened" relationship. The normal indirect "join" table values are extracted into each side of the relationship, giving the appearance of a direct many-to-many relationship between entities(classes). This relationship is interesting because Student is an entity in the School model but ScheduledClass is an entity in the Course model.
When I tried to create foreign key constraints using "Generate SQL", I only got some constraints, not all of them.
All I got from two models:
ALTER TABLE SCHEDULED_CLASS ADD CONSTRAINT SCHEDULED_CLASS_SCHEDULE_FK FOREIGN KEY (SCHEDULE_ID) REFERENCES SCHEDULE (SCHEDULE_ID);
ALTER TABLE SCHEDULED_CLASS ADD CONSTRAINT SCHEDULED_CLASS_COURSE_FK FOREIGN KEY (COURSE_ID) REFERENCES COURSE (COURSE_ID);
ALTER TABLE SCHEDULED_CLASS ADD CONSTRAINT SCHEDULED_CLASS_CLASSROOM_FK FOREIGN KEY (CLASSROOM_ID) REFERENCES CLASSROOM (CLASSROOM_ID);
ALTER TABLE STUDENTPARENT ADD CONSTRAINT STUDENTPARENT_STUDENT_FK FOREIGN KEY (PARENT_ID) REFERENCES STUDENT (PERSON_ID);
ALTER TABLE STUDENTPARENT ADD CONSTRAINT STUDENTPARENT_PARENT_FK FOREIGN KEY (PARENT_ID) REFERENCES PARENT (PERSON_ID);
ALTER TABLE STUDENT_SCHEDULED_CLASS ADD CONSTRAINT STUDENT_SCHEDULED_CLASS_STUDENT_FK FOREIGN KEY (STUDENT_ID) REFERENCES STUDENT (PERSON_ID);
I think some foreign key constraints are missing, like
SCHEDULED_CLASS and TEACHER(EMPLOYEE), EMPLOYEE and ADDRESS, STUDENT and STUDENT_SCHEDULED_CLASS …..
Is it bug in Entity Modeler or somewhere couldn't figure out the horizontal/vertical inheritance in the model?
Thanks
Kevin
"This communication is confidential and may contain
privileged and/or copyright material. If you are not the intended recipient you
must not use, disclose, copy or retain it. If you have received it in error
please immediately notify me by return email, delete the emails and destroy any
hard copies. ANZ National Bank Limited does not guarantee the integrity of this
communication, or that it is free from errors, viruses or
interference."
_______________________________________________
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