• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Multi tables having a to-many relationship to the same table
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multi tables having a to-many relationship to the same table


  • Subject: Multi tables having a to-many relationship to the same table
  • From: "Rohrbaugh, John H" <email@hidden>
  • Date: Thu, 27 Apr 2006 11:03:49 -0400
  • Thread-topic: Multi tables having a to-many relationship to the same table

We have a change history logging table named ‘ChangeHistory’ and would like several tables to have a to-many relationship to it.  

 

Student table has a to-many relationship to ChangeHistory named ‘toStudentChangeHistory’

 

School table has a to-many relationship to ChangeHistory named ‘toSchoolChangeHistory’

 

ChangeHistory includes an attribute named ‘foreignKeyId’ that will contain the primary key of the table that points to it; ie studentId or schoolId.  Thought I would also have a ChangeHistory attribute named ‘changeHistoryType’ that would distinguish the tables (value either ‘STUDENT’ or ‘SCHOOL’)

 

toStudentChangeHistory  join would be:

   Where Student.studentId = ChangeHistory.foreignKeyId   and  ChangeHistory.changeHistoryType = ‘STUDENT’

 

toSchoolChangeHistory  join would be:

   Where School.schoolId = ChangeHistory.foreignKeyId   and  ChangeHistory.changeHistoryType = ‘SCHOOL’

 

I can not figure out how to specify the changeHistoryType part of the join in the EOModeler.

 

Thought of a few work-a-rounds, but would rather not add additional attributes.  For instance, could add the changeHistoryType to both the Student and School tables.  Just seems like there should be a better way of doing this.

 

Thanks for your help.

 

JohnR

 

 _______________________________________________
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

  • Follow-Ups:
    • Re: Multi tables having a to-many relationship to the same table
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: CUSTOM ORDERING IDEA
  • Next by Date: Re: Switch Component question...
  • Previous by thread: Flat file subversion EOF adaptor
  • Next by thread: Re: Multi tables having a to-many relationship to the same table
  • Index(es):
    • Date
    • Thread