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: "Daniele Corti" <email@hidden>
- Date: Fri, 20 Apr 2007 15:55:50 +0200
2007/4/20, Lachlan Deck <email@hidden>:
Hi there,
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?
e.g.
EOEditingContext ec = this.session().defaultEditingContext();
Client c = new Client();
ec.insertObject(c);
boolean b = true;
obj.setBogusBooleanAttribute(b);
ec.saveChanges();
Anyone with any ideas?
>> In the plist its definition is:
>> {
>> allowsNull = Y;
>> columnName = bogusBooleanAttribute;
>> externalType = TINYINT;
>> name = bogusBooleanAttribute;
>> valueClassName = NSNumber;
>> valueType = c;
>> },
>
> mmm I don't think this is a boolean definition... open you
> EOModeler and
> check if this bogusBooleanAttribute is a boolean
This is a normal definition for boolean (apart from externalType
which in this case is mysql specific). See the EOModeler docs as to
valueType = c.
>> Why doesn't it have a parameter like the others?
>>
>> with regards,
>> --
>>
>> Lachlan Deck
with regards,
--
Lachlan Deck
--
Daniele Corti
AIM: S0CR4TE5
Messenger:
email@hidden
_______________________________________________
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