Re: How can I cast a NSMutableDictionary to a EOEnterpriseObject
Mike Schrag <[email protected]> Wed, 19 Nov 2008 16:36:21 -0500
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
>>>> All objectWithRawRow does is to extract the PK and then calls >>>> faultWithPrimaryKey() (IIRC). So if the EO has not been fetched >>>> and cached, this goes back to the database. >>> >>> Really? >> >> No, it calls ec.faultForRawRow(row, entityName) >> which calls ec.faultForRawRow(row, entityName, this) >> which calls objectstore.faultForRawRow(row, entityName, ec)... > > which extracts the GID and calls > editingContext.faultForGlobalID(gid, editingContext); > > Slightly different call path than I recalled, but the same effect. Yeah, the important part is "not been fetched and cached". It creates a fault for the GID of the raw row. If that GID is in the snapshot cache, you will not hit the db, but if you just did a raw row query against your db and got a bunch of rows back that have not been cached in the snapshot cache, it will do a second database hit to fill in the snapshot even if the raw row dictionary you have represents exactly what it would pull in that second query. This was the point of my earlier gripe, actually. ms