On 4/12/06, João Fernandes <[EMAIL PROTECTED]> wrote:
Well I also realized the problem using the alias instead of the table name but if you want to build custom queries with joins you should take a look to the createquery() method. The Query Object have multiple functions that allow you to build all kind of custom queries, including joining tables.
João Fernandes
-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Brian Kotek
Sent: Thu 13-Apr-06 12:49 AM
To: [email protected]
Subject: Re: [Reactor For CF] Determine table names in custom query?
Thanks for the response Joao, but there are two problems with that. First, I
already know the alias and I want the actual table name that is mapped to
the alias. Placing the alias into the SQL statement would result in an error
if the alias is different from the table name (which mine is).
And second, if my query needs to join to a table outside the current object
for some reason, I would want to be able to get the table name for *any*
alias that I give it.
On 4/12/06, João Fernandes <[EMAIL PROTECTED]> wrote:
>
> Your gateway has a private function getObjectMetadata() that will return a
> reactor.base.abstractMetadata object.
>
> That object has several methods like getAlias() ;)
>
> so you could use
>
> <cffunction name="myCustomGatewayMethod">
> select *
> from #getObjectMetadata().getAlias()# where ...
> </cffunction>
>
> Not tested but it should work
>
> João Fernandes
>
>
-- 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/
-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

