You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by Apache Wiki <wi...@apache.org> on 2007/03/22 07:13:31 UTC

[Ws Wiki] Update of "WorkingWithCompoundKeys" by lresende

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.

The following page has been changed by lresende:
http://wiki.apache.org/ws/WorkingWithCompoundKeys

------------------------------------------------------------------------------
  Relationships between tables are in terms of primary keys and foreign keys and so foreign keys can also be compound.  The following example illustrates a relationship using a compound foreign key:
  
  {{{
- TBD: need an example here (see JIRA 841)
+    <Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+         
+       <Table tableName="ORDERDETAILS">
+          <Column columnName="ORDERID" primaryKey="true"/>
+          <Column columnName="PRODUCTID" primaryKey="true"/>
+       </Table>
+     
+       <Table tableName="ORDERDETAILSDESC">
+          <Column columnName="ID" primaryKey="true"/>
+       </Table>
+ 
+       <Relationship name="orderDetailsDesc" primaryKeyTable="ORDERDETAILS" 
+                      foriegnKeyTable="ORDERDETAILSDESC" many="true">
+          <KeyPair primaryKeyColumn="ORDERID" foriegnKeyColumn="ORDERID"  />
+          <KeyPair primaryKeyColumn="PRODUCTID" foreignKeyColumn="PRODUCTID" />
+       </Relationship>
+    </Config>
+ 
  }}}
  

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@ws.apache.org
For additional commands, e-mail: general-help@ws.apache.org