Re: delete rule and class property
Re: delete rule and class property
- Subject: Re: delete rule and class property
- From: Chuck Hill <email@hidden>
- Date: Tue, 6 Nov 2007 09:45:28 -0800
On Nov 6, 2007, at 5:43 AM, Johann Werner wrote:
Hi,
I encountered a situation where I wanted to delete an eo and got a
referential integrity fault from the database. I could resolve that
problem but it left me with the unanswered question why it behaved
not as I expected:
I have two entities A <-->> B where both relationships have
"nullify" as delete rule. Entity A is some sort of lookup entity
where normally the relationship A -->> B is not used so I disabled
the class property for it. The relationship B --> A in contrast is
a class property.
When I delete an eo of entity A the delete rule to nullify all
references in B is not executed. Only by setting the relationship
back to a class property it works as expected. In PWO there is a
chapter on delete rules and one-sided relationships where it is
mentioned that you have to provide the delete rule in code but that
would be if only one relationship exists. In my case both are
present in the model file so EOF should know about it and follow
the delete rule, shouldn't it?
I have heard several people mention the "model it, but don't make it
a class property" theory for things like this. Every time I test
this, EOF only pays attention to things that are class properties.
Things that are not class properties may affect the schema generation
(I have never tested that), but I don't see them affecting EOF's
runtime actions.
Does "one-sided" mean only one relationship between two entities
exists or only one relationship exists/is a class property? I
didn't find more precise information on that.
Our meaning was that the relationship is only modeled in one
direction. In your example, B --> A.
PS: Could it be that in the latest WOLips the view filter in the
package explorer is broken? I get only the standard java view
filter. (on eclipse 3.3.1.1 with wolips 3.3.4603)
Wrong list for that question. And I don't know the answer. :-)
Chuck
--
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