Re: Vertical inheritance cascade deletes
Re: Vertical inheritance cascade deletes
- Subject: Re: Vertical inheritance cascade deletes
- From: Ken Anderson <email@hidden>
- Date: Fri, 17 Jun 2005 08:03:39 -0400
Yes, the parent is marked as abstract. Fetching, saving, and using
objects are not a problem - it's only a problem with cascade deletes
where the relationship is defined in the parent entity.
On Jun 17, 2005, at 1:43 AM, Lachlan Deck wrote:
Hi there,
On 17/06/2005, at 2:23 PM, Ken Anderson wrote:
I have a model that utilizes vertical inheritance (User -> Client)
that is having trouble with cascade deletes. I can't seem to
figure out what kind of structure EOF wants to properly delete
related to-many objects when the relationship is on the parent
entity.
By default, the to-many relationship will become a flattened to-
many relationship from the parent entity. With this setup, when
you try and delete an instance of the sub-entity, EOF crashes
complaining about not being able to find a valid qualifier type
(really nonsense):
Doesn't this depend on whether or not the parent entity is set to
abstract? If not set as abstract then you need to supply a
qualifier - otherwise there shouldn't be a problem.
See: http://developer.apple.com/documentation/WebObjects/
UsingEOModeler/index.html --> Modeling Inheritance --> Vertical
Mapping --> 3:
--quote--
In the Advanced Entity Inspector, mark the parent entity as
abstract if you won’t ever instantiate Person objects, as shown in
Figure 6-4.
If you need to instantiate the parent entity (Person objects),
however, don’t mark the parent entity as abstract. If you want to
instantiate objects of the parent entity, you also need to assign a
restricting qualifier to it. You need to assign a restricting
qualifier to any entity in a vertical inheritance hierarchy that is
not abstract and that has subentities (leaf nodes).
This is necessary so you can fetch objects of the parent type
without also fetching the characteristics of the parent’s
subentities. That is, when fetching Person objects, you don’t also
want to fetch attributes in Person’s subclasses, Employee and
Customer. You do this by assigning a restricting qualifier to the
Person entity. See “Implementing a Restricting Qualifier” to learn
how to do this.
I'm using vertical inheritance without a problem (my parent
entities are abstract, however).
with regards,
--
Lachlan Deck
_______________________________________________
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