Hi Erik,
I just posted something about this but I'm not sure if it's gone onto the mailing list yet. I think it answers your question though. This works with the getByFilter() method on a gateway object but allows you to return an iterator (which you can then call the getArray() method to return your query as an array of objects.
You have to alter some core reactor code though. Perhaps it could be committed to the next release if anyone likes it.
In the abstractGateway.cfc just replace:
<cfif format EQ "iterator">
<cfset r_Object = CreateObject("component",
"reactor.iterator.
BasicIterator").init(
getByQuery(QueryObj),
_getReactorFactory().createRecord(this.getObjectMetadata().getAlias())
)>
<cfreturn r_Object>
</cfif>
with this:
<cfif format EQ "iterator">
<cfset r_Object = CreateObject("component",
"reactor.iterator.iterator").init(
_getReactorFactory(),
this.getObjectMetadata().getAlias())>
<cfreturn r_Object>
</cfif>
You can the call your object like this:
<cfset myObjectIterator = reactor.createGateway("myObject").getByFilter(format="iterator")>
<cfset myObjectArray = myObjectIterator.getArray()>
Hope this helps,
Tom
--
Tom Bishop
http://www.webstoreinnovations.com