• 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
Re: EO inheritance clarification needed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EO inheritance clarification needed


  • Subject: Re: EO inheritance clarification needed
  • From: Dev WO <email@hidden>
  • Date: Wed, 13 Oct 2004 16:27:12 +0200

Thanks Ken,

Xavier,

The primary key needs to be in the sub-entity tables so they can be related to the parent table.
Thanks, I'm starting to feel better;)
If you need to work with the data manually, I suggest triggers (does MySQL have triggers?), or whatever other data integrity checking is available, to make sure that you:
I don't want to work manually, I was just wondering how WO and EO manage this to prevent the duplicated personID.
When I'll create a user or a client in my WO app, it'll will generate a personID in the Person table and in the subentity by "magic"?

1) Always have a record in the person table with the same personID as client or user
2) Never have a record in client and user with the same personID.


Ken

On Oct 13, 2004, at 9:41 AM, Dev WO wrote:

Hi,
I'm actually having some problem with EO and inheritance...
I've got an abstract class "Person" and 2 sub-entities "client" and "user", I've got a personID attribute in Person which is the PK (and so should be the PK for both client and user).
What I don't understand is when I generate the tables (on MySQL for now), I get a Person table with a personID attribute, but I also got a personID attribute in both the user and client tables...I don't know if this is the normal behavior?
If I create a client and a user directly in MySQL, I can create them with the same personID!?


So to summarize, does the attributes in the person table should be "duplicated" in each table of the sub-entities (inside the DB)?
and if it's the case what is the mechanism that should prevent from having 2 identical personID in the sub-entities?


Thanks a lot for helping me clarify this.

Xavier

_______________________________________________
WebObjects-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/webobjects-dev



_______________________________________________ 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
References: 
 >EO inheritance clarification needed (From: Dev WO <email@hidden>)

  • Prev by Date: EO inheritance clarification needed
  • Next by Date: OTCQuicktime
  • Previous by thread: EO inheritance clarification needed
  • Next by thread: OTCQuicktime
  • Index(es):
    • Date
    • Thread