I'm trying to do a grouped where clause, something like:

SELECT Something
FROM Table
WHERE
(thisField = 'this" OR thisField ='that' OR thisField='somethingElse')
AND City = 'New York'
AND State = 'NY'

I searched through the mail archives and came up with a solution provided by Doug, but I'm having a hard time wrapping my mind around what is actually going on.  Here's what was posted:

==============================

<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)#" />

=================================

It looks like there is a bunch of "ORs" in there, but I'm really confused on the functionality.  Would anyone like to try taking a crack at my sample above (using grouped ORs and ANDs) and converting this to a Reactor query?  I think if I can see what my query looks like in Reactor--I just may get it.

Thanks,
Brad





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

Reply via email to