This is done too.  Here's an example:

<cfset EntryGateway = reactor.createGateway("Entry") />

<cfset query = EntryGateway.createQuery() />
<cfset where = query.getWhere() />
<cfset where.setMode("or").addWhere(where.createWhere().isLte("Entry",
"entryId", 2).setMode("or").isGte("Entry", "entryId", 174)).isLte("Entry",
"views", 700) />

<cfdump var="#EntryGateway.getByQuery(query)#" />

I rather like this!! Thanks for the suggestion, Doug!

Oh, the andWhere and orWhere have been removed.  There is still a
negateWhere which can be used to negate a where expression.

50/50 chance this will be committed tonight.

Doug

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Doug Hughes
Sent: Tuesday, April 25, 2006 9:15 PM
To: [email protected]
Subject: RE: [Reactor For CF] grouping of where clauses

I think Doug's suggestion makes the most sense. It seems to be the most
consistent with the rest of the oo queries.

Doug

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Sean Corfield
Sent: Tuesday, April 25, 2006 7:48 PM
To: [email protected]
Subject: Re: [Reactor For CF] grouping of where clauses

On 4/25/06, Doug Arthur <[EMAIL PROTECTED]> wrote:
> What about setting the mode and then having and addWhere function?
>
> setMode("and")
> addWhere(createWhere())
> addWhere(createWhere())
> setMode("or")
> addWhere(createWhere())
> setMode("and")
> addWhere(createWhere())

This would be fine but why not just make andWhere() and orWhere() take
a single "where" object instead?
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

 

-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/



 

-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/



 

-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/


Reply via email to