You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Jeff Barrett <JB...@sawyermedia.com> on 2002/05/10 00:26:46 UTC

ATTN: Turbine/Torque Developers (was: RE: ant init error messages)

Are any of the Turbine or Torque Developers out there who can comment on
this?

-----Original Message-----
From: Scott Eade [mailto:seade@backstagetech.com.au]
Sent: Thursday, May 09, 2002 2:03 PM
To: turbine-user
Subject: Re: ant init error messages


> From: "Jeff Barrett" <JB...@sawyermedia.com>
> 
> It sounds like the SQL generation of foreign key constraints in schema
> xml files is wonky.
> 
> Specifically: when the foreign-key's attribute foreignTable refers to
a
> table alias, it's not finding the real table name and substituting it
> into the "ALTER TABLE" sql.
> 
> Do I have a correct understanding of the problem?
> 
> +jeff
> 
I think that about sums it up.

The problem is that
WEB-INF\build\bin\torque\templates\sql\base\mysql\foreignkey.vm
And the variants for the other databases use $fk,ForeignTableName
without
checking to see if it is an alias for another table (the name of which
should then be substituted in its place).

Producing a fix is hampered not only by my incomplete knowledge of how
this
works ;-), but also because it seems that the fact that ForeignTableName
is
an alias is not available within foreignkey.vm.

I am thinking that the solution will require some additional processing
back
in \WEB-INF\build\bin\torque\templates\data\Control.vm to look through
all
of the ForeignTableName values for all Tables, check the Table entry
that
represents that indicated by ForeignTableName and substitute Table.Alias
for
ForeignTableName when Table.isAlias() is true.

For this solution to work it will be necessary to go
$table.setForeignTableName($foreignTable.Alias) - is this set method
even
available?  An alternative would be to pass an additional List to
foreignKey.vm containing tableName, tableNameAlias pairs.

Can someone that is more familiar with this code confirm my logic?

Cheers,

Scott


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Turbine/Torque Developers (was: RE: ant init error messages)

Posted by Naga Pappireddi <na...@jalvamedia.com>.
Jeff,
Turbine developers are in different alias. Check this out:
http://jakarta.apache.org/turbine/turbine-2/mail-lists.html
Naga

----- Original Message -----
From: "Jeff Barrett" <JB...@sawyermedia.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Thursday, May 09, 2002 3:26 PM
Subject: ATTN: Turbine/Torque Developers (was: RE: ant init error messages)


Are any of the Turbine or Torque Developers out there who can comment on
this?

-----Original Message-----
From: Scott Eade [mailto:seade@backstagetech.com.au]
Sent: Thursday, May 09, 2002 2:03 PM
To: turbine-user
Subject: Re: ant init error messages


> From: "Jeff Barrett" <JB...@sawyermedia.com>
>
> It sounds like the SQL generation of foreign key constraints in schema
> xml files is wonky.
>
> Specifically: when the foreign-key's attribute foreignTable refers to
a
> table alias, it's not finding the real table name and substituting it
> into the "ALTER TABLE" sql.
>
> Do I have a correct understanding of the problem?
>
> +jeff
>
I think that about sums it up.

The problem is that
WEB-INF\build\bin\torque\templates\sql\base\mysql\foreignkey.vm
And the variants for the other databases use $fk,ForeignTableName
without
checking to see if it is an alias for another table (the name of which
should then be substituted in its place).

Producing a fix is hampered not only by my incomplete knowledge of how
this
works ;-), but also because it seems that the fact that ForeignTableName
is
an alias is not available within foreignkey.vm.

I am thinking that the solution will require some additional processing
back
in \WEB-INF\build\bin\torque\templates\data\Control.vm to look through
all
of the ForeignTableName values for all Tables, check the Table entry
that
represents that indicated by ForeignTableName and substitute Table.Alias
for
ForeignTableName when Table.isAlias() is true.

For this solution to work it will be necessary to go
$table.setForeignTableName($foreignTable.Alias) - is this set method
even
available?  An alternative would be to pass an additional List to
foreignKey.vm containing tableName, tableNameAlias pairs.

Can someone that is more familiar with this code confirm my logic?

Cheers,

Scott


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>