ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Ws Wiki] Update of "Tuscany/TuscanyJava/DAS Java Overview/RDBDAS Java User Guide/Generated Database Keys" by KevinWilliams
Date Tue, 10 Oct 2006 19:22:52 GMT
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 KevinWilliams:
http://wiki.apache.org/ws/Tuscany/TuscanyJava/DAS_Java_Overview/RDBDAS_Java_User_Guide/Generated_Database_Keys

------------------------------------------------------------------------------
  
     // Create a new Company
     DataObject company = root.createDataObject("COMPANY");
+    //Initialize properties of the new company
     company.setString("NAME", "Do-rite Pest Control");
  
     // Flush changes      
     das.applyChanges(root);
  
-    // Save the id
+    // Inspect the id
     Integer id = (Integer) company.get("ID");
  }}}
  
- The first line creates a DAS instance form the factory passing it a stream over the file
"CompanyConfig.xml".  Here is that fin ein its entirety:
+ The first line creates a DAS instance form the factory passing it a stream over the file
"CompanyConfig.xml".  Here are the contents of that file:
  
  {{{
     <Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
@@ -34, +35 @@

     </Config>
  }}}
  
+ Note that only the 'ID' column is specified in the file since this is the only column we
need to attach any information to.  Notice also that when the new Company instance in created,
no value is assigned to the 'ID' property since this value will be supplied by the database
when the insert operation is performed.
+ 
+ As part of the "apply changes" processing, the DAS will propogate the database-supplied
key values back to the respective DataObjects in the graph. The purpose of this is to make
the values available to the application if needed.
+ 

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


Mime
View raw message