Re: EOModeler Generating Bad SQL
Re: EOModeler Generating Bad SQL
- Subject: Re: EOModeler Generating Bad SQL
- From: email@hidden
- Date: Tue, 11 Nov 2003 13:21:50 CDT
- Priority: 3 (Normal)
[demime could not interpret encoding binary - treating as plain text]
That's not neccesarily bad SQL. EOF generally uses, shoot I forget the
proper terminology, 'bind' variables or something? It's a way of talking
to the db through JDBC I believe. Anyway, what I know is that queries in
the debug trace frequently show up like that, with ? marks in place of
the variables, but the next line in the debug trace should show you what
variables are put in place of those question marks.
Why is it using a question mark placeholder for something you've 'fixed'
to 'yes'? I don't know. But it shouldn't neccesarily cause a problem.
But how are you construction the qualifier on the boolean/bit key? 'yes'
may work due to legacy reasons, but I never use it myself. I find that
either "true" (NOT in quotes) or "new Integer(1)" work for me for
constructing bit/boolean database qualifiers.
That is, try all of these, and at least one, if not all, of them should work:
EOQualifier qual =
EOQualifier.qualifierWithQualifierFormat("administratorStatus = true", null);
EOQualifier qual =
EOQualifier.qualifierWithQualifierFormat("administratorStatus = %@", new
NSArray( new Boolean(true) ));
EOQualifier qual =
EOQualifier.qualifierWithQualifierFormat("administratorStatus = %@", new
NSArray( new Integer(1) ));
Good luck,
--Jonathan
On Mon, 10 Nov 2003 23:35:49 -0800 MadBrowser wrote:
> EOModeler WO 5.2.2 on Panther 10.3.1.
>
> I have the following qualifier:
> ((emailAddress = $emailAddress) and (password = $password) and
> (administratorStatus = 'yes'))
>
> This generates the following SQL:
> SELECT administrator_status, country, editor_status, email_address,
> first_name, last_name, password, quality_cost_preference, rec_num,
> street_address_1, street_address_2, us_city, us_state, username,
> wants_casino_offers, wants_newsletter, year_of_birth, zip_code FROM
> user_account WHERE (email_address = ? AND password = ? AND
> administrator_status = ?)
>
> Why is it trying to take administratorStatus as a variable when I am
> explicitly requiring that the field contain the value 'yes'?
>
> I have been fiddling with this and can't seem to figure this out.
>
> Am I doing something wrong or is this a bug?
>
> Thanks,
> Hunter
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.