db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hartwig, Thomas" <t.hart...@crapoud.com>
Subject n-to-n relationship howto
Date Wed, 21 Jan 2004 11:08:14 GMT
Hello,

I'm sure there are a lot of users already needed a n-to-n relationship 
solution. Does Torque support this with a useable modell or do I have to 
implement this. I have looked thru the docs but all I found was: 1-to-n

Schema suggestion with a n-to-n relation, but this is not enough I'm afraid:

     <table name="A" description="Table">
         <column name="id"
             autoIncrement="true"
             required="true"
             primaryKey="true"
             type="BIGINT"/>
     </table>
     <table name="B" description="Table">
         <column name="id"
             autoIncrement="true"
             required="true"
             primaryKey="true"
             type="BIGINT"/>
     </table>

     <table name="A_B" description="Table">
         <column name="id"
             autoIncrement="true"
             required="true"
             primaryKey="true"
             type="BIGINT"/>
         <column
             name="A_id"
             type="BIGINT"/>
         <column
             name="B_id"
             type="BIGINT"/>
         <foreign-key foreignTable="A">
             <reference
                 local="A_id"
                 foreign="id"/>
         </foreign-key>
         <foreign-key foreignTable="B">
             <reference
                 local="B_id"
                 foreign="id"/>
         </foreign-key>
     </table>


Thanks for attention
Greetings
Thomas

---------------------------------------------------------------------
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