Re: Single Table inheritance and EM question[SOLVED]
Re: Single Table inheritance and EM question[SOLVED]
- Subject: Re: Single Table inheritance and EM question[SOLVED]
- From: William Hatch <email@hidden>
- Date: Wed, 20 Aug 2008 16:51:07 -0400
Damn. So, I was using the static fetch methods inherited from the
abstract parent fetchSummaries.... within my own static fetches. I
switched to using the ones from the _Parent... where it explicitly
says fetchDay/Hour/Month summaries... Maybe I should switch brands of
coffee? Or go directly to beer. Thanks and sorry for any time wasting.
On Aug 20, 2008, at 4: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? 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, but again
thought this was the standard way to go about implementing single
table inheritance. Thanks Chuck.
Bill
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
_______________________________________________
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