Title: Spam:RE: [CFCDev] Ad-hoc queries using Data Gateway objects
Hello,
 
Here's an idea: you could pass a collection of criteria objects (so in this case a criteria object with color=blue and another criteria object with size=large and shape=triangular) and then a flag on how to combine them (so OR for this case). You could then use SQL union or intercept to build up a recordset to return.
 
/t


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seth Johnson (KW)
Sent: Wednesday, January 11, 2006 5:32 PM
To: [email protected]
Subject: RE: [CFCDev] Ad-hoc queries using Data Gateway objects

Most of the search forms I have combine all the values using "and" so I didn't even consider how I would handle a more complicated query like in your example.
 
To support advanced conditional statements using a Filter object there would need to be a way to create groups of clauses and then a way to chain those groups together using "and" or "or".
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of RADEMAKERS Tanguy
Sent: Wednesday, January 11, 2006 9:22 AM
To: [email protected]
Subject: Spam:RE: [CFCDev] Ad-hoc queries using Data Gateway objects

Hello,
 
I've got a question about using these filter/criteria objects.
 
Say i have three basic attributes to filter on:
- color
- size
- shape
 
How would i use a filter/criteria object to indicate that i want a record set of all widgets "...where color=blue or (size=large and shape=triangular)"?
 
I can see how to make all criteria AND or OR together, but how would i mix and match?
 
Regs,
/t


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Duba, Phillip
Sent: Wednesday, January 11, 2006 3:02 PM
To: [email protected]
Subject: RE: [CFCDev] Ad-hoc queries using Data Gateway objects

Ok, that makes sense since I thought the getById() method took a single id value not a list of them. My DAOs have something similar to your read() method and they always return a singular object whether it’s read or saving data. As for the filter method, wouldn’t this be a good place to pass in a structure and loop through that structure to create the dynamic where clause? I figure whatever you may be using as a controller can construct the structure and pass it into the method this way you don’t have to worry about StructKeyExists() or IsDefined() or default checking. That’s the tact I would probably take. The difficulty would be in synching the structure items with the fields in the database. Thanks,

 

Phil

 

 
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to