You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Scott Eade <se...@backstagetech.com.au> on 2003/01/21 05:11:02 UTC

Generating join methods - is there a bug?

Is it just me or does Torque 2.2 no longer generate join methods?  The code
exists in om,Object.vm, but I don't think it is ever being invoked.

Has anyone had a method get${relCol}Join${relCol2} generated by Torque 2.2
(where relCol is an entity whose foreign key is declared in the schema for
that current object and relCol2 is a third entity whose foreign key is
declared in the schema for relCol)?

I think there may be a bug in om,Object.vm that mucks up the check to see if
relCol2 is the same as the entity currently being generated (it only seems
to be evaluated for the first fk defined for relCol which is always (at
least in my case) the object being generated - and hence the methods are
never generated).

I'll keep looking, but I am interested to know if anyone else has also hit
this problem.

Cheers,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
.Mac Chat/AIM: seade at mac dot com


Re: Generating join methods - is there a bug?

Posted by Scott Eade <se...@backstagetech.com.au>.
I tracked this down to the following change:

http://cvs.apache.org/viewcvs/jakarta-turbine-torque/src/templates/om/Object
.vm.diff?r1=1.40&r2=1.41&diff_format=h

By adding some debugging code I have found that for me the "!" on the line
that was added:

    #set ( $doJoinGet = !$tblFK2.isForReferenceOnly())

Doesn't work (i.e. "!false" is the same as "false").

If I replace the above line with:

    #if ($tblFK2.isForReferenceOnly())
        #set ($doJoinGet = false)
    #else
        #set ($doJoinGet = false)
    #end

Then everything works fine - i.e. the Join methods I am expecting are
generated.

So does the "!false" syntax work for anyone?

I'll submit a patch anyway.

Cheers,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
.Mac Chat/AIM: seade at mac dot com
 

On 21/01/2003 3:11 PM, "Scott Eade" <se...@backstagetech.com.au> wrote:

> Is it just me or does Torque 2.2 no longer generate join methods?  The code
> exists in om,Object.vm, but I don't think it is ever being invoked.
> 
> Has anyone had a method get${relCol}Join${relCol2} generated by Torque 2.2
> (where relCol is an entity whose foreign key is declared in the schema for
> that current object and relCol2 is a third entity whose foreign key is
> declared in the schema for relCol)?
> 
> I think there may be a bug in om,Object.vm that mucks up the check to see if
> relCol2 is the same as the entity currently being generated (it only seems
> to be evaluated for the first fk defined for relCol which is always (at
> least in my case) the object being generated - and hence the methods are
> never generated).
> 
> I'll keep looking, but I am interested to know if anyone else has also hit
> this problem.
> 
> Cheers,
> 
> Scott