Re: Inheritance...
Re: Inheritance...
- Subject: Re: Inheritance...
- From: Mike Schrag <email@hidden>
- Date: Thu, 8 May 2008 11:27:58 -0400
There are a number of issues with prefetching relationships that
relate back to an abstract entity.
Yay... Is this true also of single-table inheritance?
Yes.
Just to get it straight, you keep the not-null constraints in the
model, but skip them in the db? Can't find docs on this...
Yes. Welcome to the awesome docs on inheritance in EOF. They don't
document a LOT of stuff. Just try to understand the docs on vertical
-- it's impossible. I believe Entity Modeler does NOT automatically
do this right now, but it briefly did and after a knock-down-drag-out
"discussion" a year or two ago, it was taken back out, but I'm going
to put it back in because ... well ... because I can and I want it
there :)
Also, I've been reading the UsingEOModeler part of the old Apple's
WO documentation, and when modeling single-table inheritance it uses
the integers 2 and 9 (as opposed to for example 1 and 2) to
designate two different subentities. The docs say that later on they
would say why they used those two integers, but never do... What's
that all about? The example in the wiki does not mention this, but
then again it does not mention much at all...
All that matters is that you have some restricting qualifier that
specifies how to differentiate the two entities (the value doesn't
matter, but you do need some attribute that specifies which one is a
SubEntity1 and which one is a SubEntity2). If you use Wonder, I
recommend turning on
er
.extensions
.ERXEnterpriseObject.applyRestrictingQualifierOnInsert=true . If you
don't, you will also need to set the value of your restricting
qualifier in your awakeFromInsertion so new objects of your entity
type get assigned properly (meaning, if you have a type = 2
restricting qualifier, you need to setType(2) in awakeFromInsertion).
applyRestrictingQualifierOnInsert in Wonder will automagically look at
your restricting qualifier and figure out what to set for you, so it's
just one less thing to mess up.
ms
_______________________________________________
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