I'm a Reactor noob and have been digging through the documentation,
but I haven't found answer. Would someone mind helping me out on a
couple of syntax questions?
In a reactor OO query, what is the "ORDER BY" syntax if I wanted to
use ASC or DESC? For example, here's a query I might use within a
function (I'm using MG Unity):
<cfargument name="userIDVar" default="#listFirst(getAuthUser())#">
<cfset var dbservice = getModelGlue().getORMService() />
<cfset var data = dbservice.createGateway("userdata") />
<cfset var dataQuery = data.createQuery() />
<cfset dataQuery.getWhere().isEqual("userdata", "data_userid",
userIDVar) />
<cfset query = data.getByQuery(dataQuery) />
<cfset arguments.event.setValue("wptQuery", query) />
So if I had a column named "dateAdded" and wanted to sort descending,
what would the syntax be?
Next let say I joined the above query with another table
(relationships are already configured in reactor.xml) named data
comments via:
<cfset dataQuery.join("userdata","datacomments")>
So instead of sorting by the "dateAdded" column, I wanted to group by
a "commentDate" column in the datacomments table. What would be the
proper syntax within reactor?
Thanks for your help,
Jon Clausen
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --