db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cedric.bra...@vallourec.fr
Subject Table definition with double relation.... help me
Date Wed, 11 May 2005 08:38:36 GMT
How do we do in the xxx-schema.xml when a table calls another and
conversely..
A user can belong to a service
A service has a person in charge
Example :
<table name="SERVICE" idMethod="idbroker">
   <column name="NumeroService" primaryKey="true" type="INTEGER" />
   <column name="NumeroResponsableService"  type="INTEGER"/>
   <column name="NomService"  type="VARCHAR" size="50"/>
     <foreign-key name="RelationService3" foreignTable="UTILSATEUR">
          <reference local="NumeroResponsableService" foreign=
"NumeroUtilisateur"/>
     </foreign-key>
</table>

<table name="UTILISATEUR" idMethod="idbroker" description="Table gérant les
utlisateurs de l'application">
   <column name="NumeroUtilisateur" primaryKey="true" type="INTEGER" />
   <column name="NumeroService" type="INTEGER" description="Référence à son
service pour obtenir tout les droits rattachés à son service"/>
   <column name="NomUtilisateur"  type="VARCHAR" size="50"/>
     <foreign-key name="RelationUtilisateur2" foreignTable="SERVICE">
          <reference local="NumeroService" foreign="NumeroService"/>
     </foreign-key>
</table>

Torque message :
BUILD FAILED: ...\torque-gen-3.1\build-torque.xml:241:
org.apache.torque.engine.EngineException: Attempt to define foreign key
with nonexistent column in table, UTILISATEUR


Thank you to answer me please
I'm french and I hope that my english will be comprehensible...

BRAJUS Cedric


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


Mime
View raw message