Re: Case sensitivity problem with primary keys in EOEditingContext.faultForRawRow

Brendan Duddridge <[email protected]> Sun, 30 Jul 2006 11:27:04 -0600
Newsgroups gmane.comp.web.webobjects.admin
Message-ID <[email protected]>
rawRowsForSQL allows you to pass in an NSArray of keys that will be  
used to map the columns from the database to the attributes in your  
model.

____________________________________________________________________
Brendan Duddridge | CTO | 403-277-5591 x24 |  [email protected]

ClickSpace Interactive Inc.
Suite L100, 239 - 10th Ave. SE
Calgary, AB  T2G 0V9

http://www.clickspace.com

On Jul 29, 2006, at 12:59 PM, [email protected]  
wrote:

>
> From: Marc Gumpinger <[email protected]>
> Date: July 29, 2006 10:19:48 AM MDT (CA)
> To: [email protected]
> Cc: [email protected]
> Subject: Case sensitivity problem with primary keys in  
> EOEditingContext.faultForRawRow
>
>
> Hi,
>
> I have a raw row (an NSDictionary) that I got from fetching for raw  
> row using an EOSQLExpression.
> When I ask the editing context to turn that raw row into a fault  
> using faultForRawRow, the ec tells me that there was no primary  
> information in the raw row dictionary.
> (EODatabaseContext throws an IllegalArgumentException with the  
> message: ... "does not contain primary key information for  
> entity" ...)
>
> After digging through the EOF source I found that the simple root  
> of the problem is case sensitivity.
> EOEntity._globalIDForRowIsFinal which is supposed to return the  
> EOKeyGlobalID iterates through the raw rows dictionary's keys to  
> find those that match the entity's primaryKeyAttributeNames.
>
> Now the problem - at least in my case - is, that the dictionary's  
> keys are all upper case (here "ID") since that's what the database  
> returned. However, the primary key's name in the eomodel is all  
> lower case (here "id"). For this simple reason, the entire  
> faultForRawRow doesn't work.
>
>
> Is there an official solution to this problem?
> I mean, it was no effort, to adopt the dictionary correspondingly  
> so that the keys also match in case sensitivity. However, due to  
> EOFs maturity I'm sure that I either made a mistake or oversaw  
> something.
>
>
> Thank you in advance
> Marc