• 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: PKs With Multitable Inheritance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PKs With Multitable Inheritance


  • Subject: Re: PKs With Multitable Inheritance
  • From: Ramsey Gurley <email@hidden>
  • Date: Thu, 28 Jul 2011 09:33:10 -0700

I just use int. I haven't hit 2 billion EOs yet.  You could always use a Long pk if you're planning on being the next iTunes or something (^_^)

Ramsey


On Jul 27, 2011, at 6:05 PM, Ted Archibald wrote:

Won't my primary keys get too big to handle?  Is int(11) in mysql sufficient enough?

On Wed, Jul 27, 2011 at 7:02 PM, Ramsey Gurley <email@hidden> wrote:

On Jul 27, 2011, at 5:23 PM, Chuck Hill wrote:

>
> On 2011-07-27, at 5:21 PM, Ted Archibald wrote:
>
>> With a project I'm working on I decided to have a number of my entities inherit from an abstract entity.  Each of these entities have their own separate table (I forget what kind of inheritance that's called...).
>
> Horizontal.


More info here:

http://wiki.objectstyle.org/confluence/display/WO/Modeling+Inheritance+with+Entity+Modeler


>> I noticed that EOF is only generating a single series of PKs for the abstract parent entity and not PKs for each child entity.  I read somewhere that that's what EOF likes to do with inheritance.  But considering I'd never be dealing with the abstract entity, is there a way to make EOF give PKs to each individual entity?
>
> There is probably a way, but it will lead to corrupt data or other problems.  EOF needs all the EOs in a hierarchy to have a unique key regardless of entity.
>
>
> Chuck


You could do it in a custom EOAdaptor, but it won't function. OpenBase plugin does this (last time I used it), and as a result, the only inheritance that works on OpenBase is single table.

EOF depends on keys that are unique across all the subclasses, because EOF needs the keys to be unique to create a relationships to the parent entities. Otherwise, what is the FK for a relationship to your parent if both tables have overlapping PKs?

It will sorta work with horizontal until you start making relationships.  It would be fundamentally incompatible with vertical because of the way the pk is shared across multiple tables.

Ramsey


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: 
 >PKs With Multitable Inheritance (From: Ted Archibald <email@hidden>)
 >Re: PKs With Multitable Inheritance (From: Chuck Hill <email@hidden>)
 >Re: PKs With Multitable Inheritance (From: Ramsey Gurley <email@hidden>)
 >Re: PKs With Multitable Inheritance (From: Ted Archibald <email@hidden>)

  • Prev by Date: Re: Dynamic loading of a component into a container?
  • Next by Date: Re: Dynamic loading of a component into a container?
  • Previous by thread: Re: PKs With Multitable Inheritance
  • Next by thread: plural entity name
  • Index(es):
    • Date
    • Thread