From 200a40b332420f94992eb39a6d0ea1cf1490ffc4 Mon Sep 17 00:00:00 2001 From: coreyg Date: Fri, 21 Nov 2014 09:30:19 +0000 Subject: Adding tuscany's website to their svn repo for svnpubsub git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1640879 13f79535-47bb-0310-9956-ffa450edef68 --- .../site-publish/workingwithcompoundkeys.html | 145 +++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 site/trunk/site-publish/workingwithcompoundkeys.html (limited to 'site/trunk/site-publish/workingwithcompoundkeys.html') diff --git a/site/trunk/site-publish/workingwithcompoundkeys.html b/site/trunk/site-publish/workingwithcompoundkeys.html new file mode 100644 index 0000000000..f74ecb2547 --- /dev/null +++ b/site/trunk/site-publish/workingwithcompoundkeys.html @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + Apache Tuscany : WorkingWithCompoundKeys + + + + + + + + + + + + + + + +
+ + + + +   + +
+ + +
+
+ + + + + + + + + +
+  Apache Tuscany > Home > DAS Overview > DAS Java > DAS Java Documentation Menu > DAS Java Developer Guide > RDB DAS Java > RDB DAS - User Guide > WorkingWithCompoundKeys + + User List | Dev List | Issue Tracker   +
+ + + + + + + +
+ + +
+ +
+
+

WorkingWithCompoundKeys

+

The RDB DAS provides the ability to work with single-column keys as well as keys composed of multiple columns (compound keys). RDB DAS clients can specify the primary key for a table as well as foreign keys that reference other tables. The primary key for a table can be identified to the DAS via configuration (typically via a configuration xml file). The following is an example config file that defines a compound primary key:

+
+
<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>
+
+   </Config>
+
+
+

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:

+
+
<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>
+
+
+
+
+
+ + +
+ + + + + + website stats + + + + + + -- cgit v1.2.3