Re: Single Table inheritance and EM question
Re: Single Table inheritance and EM question
- Subject: Re: Single Table inheritance and EM question
- From: Chuck Hill <email@hidden>
- Date: Wed, 20 Aug 2008 13:25:41 -0700
On Aug 20, 2008, at 1:06 PM, William Hatch wrote:
On Aug 20, 2008, at 2:08 PM, Chuck Hill wrote:
On Aug 20, 2008, at 10:06 AM, William Hatch wrote:
On Aug 20, 2008, at 12:15 PM, Mike Schrag wrote:
Fetches to one are resulting in generated sql to all three
types, as if I'm fetching on the abstract parent, which I'm not.
Is this fetching to one of these from a completely separate
entity, or fetching to-one from its reflexive relationship? Is
this the same problem that someone else ran into a couple days
ago with relationships from subtypes to the base class of another
entity (guido mentioned something about ERAttachment here that I
never saw?).
I have an abstract parent Summary, with three concrete sub types;
HourSummary, DaySummary, MonthSummary. Month has (optional) a to-
many to Day, which in turn has (optional) a to-many to Hour. None
of these should be getting tripped right now and are not
prefetched. So, if I fetch say HourSummary's, I see three sql
selects for Hour, Day and Month. It's almost as if the qualifying
attribute is being ignored, although each sql statement has it in
the where clause matching what I defined in the model in the Basic
tab, Qualifier field (see original post) So one fetch to a
specific Entity results in sql selects for all three, with result
sets coming back from all three. Ouch;-) At least it's fast.
Thanks Mike
Something is messed up in the model. Is the parent of each sub-
entity set correctly? Like Mike said, this sounds like the SQL
from Horizontal Inheritance. My best guess is that something in
the model (table names not _exact_ -- case counts?) is making EOF
think this is not single table inheritance.
The sub entities all have the Parent defined as Summary (using the
pop up) The Summary entity is abstract, and does not have a
corresponding table set; I thought this was correct; is it?
No, I think the table needs to be set. That is what EOF uses to
generate PKs for the inheritance hierarchy.
Each of the sub types use this as the distinguishing qualifier
(summaryRangeType="month") where summaryRangeType is a class
property and is set in the class over ride of awakeFromInsertion,
although we're not using EOF to populate it anyway,
What does "we're not using EOF to populate it anyway" mean?
but again thought this was the standard way to go about implementing
single table inheritance. Thanks Chuck.
It is (for me), other than the table on the base class.
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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