Re: Vertical inheritance cascade deletes
Re: Vertical inheritance cascade deletes
- Subject: Re: Vertical inheritance cascade deletes
- From: Wolfram Stebel <email@hidden>
- Date: Fri, 17 Jun 2005 22:54:16 +0200
Am 17.06.2005 21:46 Uhr schrieb "Ken Anderson" unter <email@hidden>:
> I take it that the relationship that the cascade is on does not exist
> in the parent?
>
> On Jun 17, 2005, at 3:39 PM, Wolfram Stebel wrote:
No you need both relations, but i normaly declare cascade only in the
flattened relation.
>> Am 17.06.2005 14:03 Uhr schrieb "Ken Anderson" unter
>> <email@hidden>:
>>
>> So you have a relation in the base class and one in the derived class.
>> in my models, everything works fine when i have the "cascade"
>> option in the
>> derived class. i never tried to have it in the base class though!
>> Check yours.
>> Hope that helps.
>> Wolfram
>>
>>
>>> 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,
_______________________________________________
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