Re: EOModeler Delete Rules, Relationship best practices
Zak Burke <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
Zak Burke wrote on 3/29/06 11:38 AM: > What is the preferred way to prevent a lookup-table record from being > removed when other records point to it? I asked this question a few weeks ago but didn't get any responses. Because there are performance issues with defining back-pointing relationships from lookup tables, I posited that a good way to handle this is to create back-pointing relationships but to NOT make them class properties. This allows for setting a Deny delete-rule on the relationship source (the lookup table) but resolves the problem of faulting zillions of rows when one of the lookup EOs is accessed. It seems like a great solution, but it doesn't work. EOF, it seems, ignores delete rules on non-class properties, as noted by Jonathan Rochkind here: http://www.wodeveloper.com/omniLists/webobjects-dev/2003/May/msg00047.html Back in RDBMS-land, I'd just assume handle this with a foreign key constraint, and I guess I can do that and trap the EOGeneralAdaptorException, but if there's a way to do this within EOModeler, I'd like to follow it and keep all my EO-relationship data in one place. Another approach is to put a fetch into the lookup EO's validateForDelete method, but that, too, puts EO-relationship outside the model. Any hints? TIA, zak burke.