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 --- ...-cpp-foreignkeyrepresentationandmanagement.html | 118 +++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 site/trunk/site-publish/rdb-das-cpp-foreignkeyrepresentationandmanagement.html (limited to 'site/trunk/site-publish/rdb-das-cpp-foreignkeyrepresentationandmanagement.html') diff --git a/site/trunk/site-publish/rdb-das-cpp-foreignkeyrepresentationandmanagement.html b/site/trunk/site-publish/rdb-das-cpp-foreignkeyrepresentationandmanagement.html new file mode 100644 index 0000000000..dad32628f2 --- /dev/null +++ b/site/trunk/site-publish/rdb-das-cpp-foreignkeyrepresentationandmanagement.html @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + Apache Tuscany : RDB DAS CPP - ForeignKeyRepresentationAndManagement + + + + + + + + + + + + + + + +
+ + + + +   + +
+ + +
+
+ + + + + + + + + +
+  Apache Tuscany > Home > DAS Overview > DAS C++ > DAS C++ Documentation Menu > RDB DAS C++ - User Guide > RDB DAS CPP - ForeignKeyRepresentationAndManagement + + User List | Dev List | Issue Tracker   +
+ + + + + + + +
+ + +
+ +
+
+

ForeignKeyRepresentationAndManagement

+ +

Database table foreign keys map to DataObjects as relationships to other DataObjects. Consider two tables: DEPARTMENT and EMPLOYEE and assume the EMPLOYEE table has a FK column DEPT_ID that references a row in the DEPARTEMENT table.

+ +

If you use the DAS to read a particular department and all of its related employees then you will end up with a DEPARTMENT DataObject that has a property named "EMPLOYEE" that is a reference to a list of related EMPLOYEE DataObjects. You can navigate directly to the employees via this property like this: department->getList("EMPLOYEE").

+ +

As DEPARTMENT PK is stored on the DataObject, a reference to a EMPLOYEE DataObject  does not need to store the DEPARTMENT FK, because the DEPARTMENT FK and DEPARTMENT PK should be the same according to Referential Integrity (RI). So, if a EMPLOYEE is removed from a DEPARTMENT to another, when DAS apply the changes back to the database, it needs only to get the PK value from the new DEPARTENT that references the EMPLOYEE and set it on its DEPARTMENT FK.

+
+
+
+ + +
+ + + + + + website stats + + + + + + -- cgit v1.2.3