Is this with WO 5.4.x or earlier? The current 5.4 examples use derby
which is a new plugin. Entity Modeler uses EOF to generate the
foreign key constraints so it's likely a derby plugin issue. In any
case, file a bug http://bugreporter.apple.com and we'll take a look.
On Jun 18, 2008, at 7:33 PM, Ren, Kevin wrote:
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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/dlee%40apple.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
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]