RE: Dumb (?) subclass question
"Anderson, Ken" <[email protected]> Fri, 7 Jan 2005 08:06:09 -0500
| Newsgroups | gmane.comp.web.webobjects.eof |
|---|---|
| Message-ID | <[email protected]> |
Thomas, You answered your own question :) Yes, ITEM should have typ !=3D 'E' = (or maybe typ <> 'E') to make sure that you don't get ITEM and ITEM_E = duplicates. Ken -----Original Message----- From: [email protected] [mailto:[email protected]]On Behalf Of Thomas Ganter Sent: Friday, January 07, 2005 5:04 AM To: Chuck Hill Cc: [email protected] Subject: Re: Dumb (?) subclass question Hi Chuck, I can rule out to accidentially create duplicates. There is no way=20 where this could happen. And this reproducably happens for every single items() relationship I=20 do on any arbitrary HEAD element. In my EO subclass of ITEM, which is ITEM_E, I have entered the=20 qualifier "(typ=3D'E')" in the advanced entity inspector, with "typ"=20 being a class property. The idea is to have items() retrieve all ITEM elements, whereas=20 item_es() only retrieve special ones. Do I need to have a qualifier in the "ITEM" properties as well? Greetings, - Thomas Am 07.01.2005 um 03:12 schrieb Chuck Hill: > Yes, you probably did something wrong in setting up the subclass. We=20 > will need more details (single table, vertical, horizontal=20 > inheritance) to discern why. As a guess, you forgot the restricting=20 > qualifier. > > If not that, then perhaps you are manually adding a duplicate in your = > code though incorrect use of EOF? > > Chuck > > > On Jan 6, 2005, at 5:08 PM, Thomas Ganter wrote: > >> Hi all, >> >> I just spent four hours searching for a bug when I found a situation=20 >> in which a to-many relationship always contained duplicate elements. >> I always was under the impression that the array I get will contain=20 >> distinct rows and never checked for duplicates. >> >> Let's say there are two tables: HEAD and ITEM with a 1:n = relationship. >> >> Whenever I say (HEAD)h.items(), I get four entries in the NSArray=20 >> when in the database there are only three. >> >> Could this be somehow due to the fact that i sublassed ITEM? >> >> If so, how can I prevent this behaviour? >> >> Greetings, >> >> - Thomas >> >> _______________________________________________ >> EOF mailing list >> [email protected] >> http://www.omnigroup.com/mailman/listinfo/eof >> > --=20 > Practical WebObjects - a book for intermediate WebObjects developers=20 > who want to increase their overall knowledge of WebObjects, or those=20 > who are trying to solve specific application development problems. > http://www.global-village.net/products/practical_webobjects > > > _______________________________________________ EOF mailing list [email protected] http://www.omnigroup.com/mailman/listinfo/eof