Re: Help: a boolean attribute always saves as null
Re: Help: a boolean attribute always saves as null
- Subject: Re: Help: a boolean attribute always saves as null
- From: Lachlan Deck <email@hidden>
- Date: Sat, 21 Apr 2007 00:35:39 +1000
Hi there,
On 20/04/2007, at 11:55 PM, Daniele Corti wrote:
2007/4/20, Lachlan Deck <email@hidden>:
On 20/04/2007, at 10:43 PM, Daniele Corti wrote:
> 2007/4/20, Lachlan Deck <email@hidden>:
>>
>> Okay, something might have changed with the model plist (with an
>> update from WOLips or something) but I can't see it :-/
>>
>> The data is being received via soap (and correctly applied to the
>> instance, as I've checked both the incoming and after setting the
>> value doing a valueForKey on the instance - which returns a
Boolean
>> that is *not* null.
>>
>> I've turned on adaptor logging to see what's going on. (See
>> bogusBooleanAttribute in sql)
>>
>> However when saving the context I get:
>>
>> [2007-04-20 15:42:55 EST] <WorkerThread15> === Begin Internal
>> Transaction
>> [2007-04-20 15:42:55 EST] <WorkerThread15> evaluateExpression:
>> <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "UPDATE
>> Client SET created = ?, bogusBooleanAttribute = NULL, modified = ?
>> WHERE id = ?" withBindings: 1:2007-02-27 16:16:28(created),
>> 22007-04-20 15:42:55(modified), 5:59(id)>
>> [2007-04-20 15:42:55 EST] <WorkerThread15> === Commit Internal
>> Transaction
I need to figure out why the boolean value is not also getting passed
a value (e.g., bogusBooleanAttribute = ? rather than it always being
= NULL).
mmm probably it can't read it... how do you set the value?
Object soapObject; // assume received
EOEditingContext ec; // assume referenced
EOEnterpriseObject eo = EOUtilities.createAndInsertInstance( ec,
entityName );
Enumeration en = new NSArray( <.... attributes ...> ).objectEnumerator
();
while ( en.hasMoreElements() ) {
String key = ( String )en.nextElement();
Object value = NSKeyValueCoding.Utility.valueForKey( soapObject, key );
NSLog.out.appendln( "incoming key:" + key + " value:" + value );
eo.takeValueForKey( value, key );
NSLog.out.appendln( "updated value:" + eo.valueForKey( key ) );
}
<...>
ec.saveChanges();
Nothing unusual logged here. The key indeed has a boolean value
(after these lines as either true/false.
with regards,
--
Lachlan Deck
_______________________________________________
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