Mailing List webobjects-dev@wocommunity.org Message #49
From: Jesse Tayler <webobjects-dev@wocommunity.org>
Subject: Re: [WO-DEV] EOQualifier.qualifierWithQualifierFormat ignores proper AND/OR precedence?!?
Date: Mon, 15 Feb 2021 09:14:40 -0500
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
I think I’d expect that SQL and I’d guess you can put in your own braces to be explicit.

I typically generate qualifiers using the ERX qualifier classes, ERXKeys and the .dot() method which is just great.

I’d only use text if I were doing something that lends specifically to string formats



On Feb 15, 2021, at 8:47 AM, OCsite <webobjects-dev@wocommunity.org> wrote:

Hi there,

is it normal that

EOQualifier.qualifierWithQualifierFormat("userType = 12 OR userType = 6 AND subjectType = 3",null)

creates

(((userType = 12) or (userType = 6)) and (subjectType = 3))

? Seems wrong, does it not? AND should always have higher operator precedence than OR, should it not? I was just bit in my tender parts by this, and I wonder whether this is the standard behaviour or some weird quirk.

Thanks,
OC


Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster