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 Xavier Maysonnave <xa...@omondo.com> on 2004/02/23 09:10:22 UTC

local and foreign have the same name in a Foreign Key

Hi,

Here is a torque schema example :

       <foreign-key foreignTable="COUNTRY" onUpdate="none" onDelete="none">
       	<reference local="COUNTRY" foreign="COUNTRY"/>
       </foreign-key>

Code generation using Torque Generator OM 3.1.

the generated code contains two getCountry() methods.

One for the local column, the other to access the foreign primary key column.

To avoid this, I change the name of one column and the problem was solved.

Do you consider this problem as a bug ?

Another situation could occur, here is the scenario :

       <foreign-key foreignTable="COUNTRY" onUpdate="none" onDelete="none">
       	<reference local="COUNTRY" foreign="COUNTRY"/>
       </foreign-key>
       <foreign-key foreignTable="COUNTRY" onUpdate="none" onDelete="none">
       	<reference local="ANOTHER_COUNTRY" foreign="COUNTRY"/>
       </foreign-key>

In that case we will also have multiple get with the same name but on the foreign column side.

Am I missing something ?

Regards.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org