I add this method to all of my custom gateways to let me get actual table
name given the aliased table name. I think with some fiddling you could get
the column aliases as well.

<cffunction name="getTableName" access="private" returntype="string"
output="false" hint="I return the table name for the passed table alias.">
        <cfargument name="tableAlias" type="string" required="true"
hint="Alias of target table." />
        <cfreturn
_getConfig().getObjectConfig(arguments.tableAlias).object.xmlAttributes.name
/>
    </cffunction>

On 9/19/07, Tom Chiverton <[EMAIL PROTECTED]> wrote:
>
> On Wednesday 19 Sep 2007, Tom Chiverton wrote:
> > Is there a handy bit of code I can call inside Reactor that will either
> > give me the list of aliased columns (suitable to just drop in to the
> > query's SELECT), or some sort of magic I should be performing ?
>
> Unless anyone comes up with a way to avoid the createObject(), I'll post a
> blog entry about the following:
>
> <cfset var queryRender =
> createObject('component','reactor.query.render.query').init(_getAlias(),
> _getAlias(), _getReactorFactory() ) />
>
> <cfquery name="q" dataSource="#_getConfig().getDsn()#" >
> select
>         #queryRender.getSelectAsString(_getConvention())#
> from #queryRender.getFromAsString(_getConvention())#
> where
>         ....
> </cfquery>
>
> --
> Tom Chiverton
>
> ****************************************************
>
> This email is sent for and on behalf of Halliwells LLP.
>
> Halliwells LLP is a limited liability partnership registered in England
> and Wales under registered number OC307980 whose registered office address
> is at St James's Court Brown Street Manchester M2 2JF.  A list of members is
> available for inspection at the registered office. Any reference to a
> partner in relation to Halliwells LLP means a member of Halliwells LLP.
> Regulated by the Law Society.
>
> CONFIDENTIALITY
>
> This email is intended only for the use of the addressee named above and
> may be confidential or legally privileged.  If you are not the addressee you
> must not read it and must not use any information contained in nor copy it
> nor inform any person other than Halliwells LLP or the addressee of its
> existence or contents.  If you have received this email in error please
> delete it and notify Halliwells LLP IT Department on 0870 365 8008.
>
> For more information about Halliwells LLP visit www.halliwells.com.
>
>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- --
> 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