db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xavier Maysonnave <xav...@omondo.com>
Subject local and foreign have the same name in a Foreign Key
Date Mon, 23 Feb 2004 08:10:22 GMT
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


Mime
View raw message