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 --- .../rdb-das-cpp-workingwithcompoundkeys.html | 146 +++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 site/trunk/site-publish/rdb-das-cpp-workingwithcompoundkeys.html (limited to 'site/trunk/site-publish/rdb-das-cpp-workingwithcompoundkeys.html') diff --git a/site/trunk/site-publish/rdb-das-cpp-workingwithcompoundkeys.html b/site/trunk/site-publish/rdb-das-cpp-workingwithcompoundkeys.html new file mode 100644 index 0000000000..41545fe964 --- /dev/null +++ b/site/trunk/site-publish/rdb-das-cpp-workingwithcompoundkeys.html @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + Apache Tuscany : RDB DAS CPP - WorkingWithCompoundKeys + + + + + + + + + + + + + + + +
+ + + + +   + +
+ + +
+
+ + + + + + + + + +
+  Apache Tuscany > Home > DAS Overview > DAS C++ > DAS C++ Documentation Menu > RDB DAS C++ - User Guide > RDB DAS CPP - 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">
+
+      <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">
+
+      <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