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/explicit-createupdatedelete.html | 147 +++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 site/trunk/site-publish/explicit-createupdatedelete.html (limited to 'site/trunk/site-publish/explicit-createupdatedelete.html') diff --git a/site/trunk/site-publish/explicit-createupdatedelete.html b/site/trunk/site-publish/explicit-createupdatedelete.html new file mode 100644 index 0000000000..cb0ae43549 --- /dev/null +++ b/site/trunk/site-publish/explicit-createupdatedelete.html @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + Apache Tuscany : Explicit CREATE,UPDATE,DELETE + + + + + + + + + + + + + + + +
+ + + + +   + +
+ + +
+
+ + + + + + + + + +
+  Apache Tuscany > Home > DAS Overview > DAS Java > DAS Java Documentation Menu > DAS Java Developer Guide > RDB DAS Java > RDB DAS - User Guide > Explicit CREATE,UPDATE,DELETE + + User List | Dev List | Issue Tracker   +
+ + + + + + + +
+ + +
+ +
+
+

Explicit Create,Update,Delete

+

The RDB DAS provides a simple, command-oriented approach for CUD operations.

+ +

The Commands can be explicit INSERT, UPDATE , DELETE SQL statements like

+
    +
  • INSERT INTO TableName (col1, col2,...) values (val1, val2,...);
  • +
  • DELETE FROM TableName where col1=? and col2=?...
  • +
  • UPDATE TableName set col1=val1, col2=val2...where col1=?...
    +With this approach, the Command is directly used by the JDBC's PreparedStamement. This approach avoids use of SDO capabilities.
  • +
+ + +

Below is example config.

+
+
<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd"> 
+
+    <Command name="insert customer"    
+    SQL="insert into CUSTOMER (ID, LASTNAME, ADDRESS) values (?, ?, ?)"
+    kind="Insert">
+    </Command>   
+    
+    <Command name="delete customer"    
+	SQL="delete from CUSTOMER where ID = ?"
+    kind="Delete">
+    </Command>
+
+    <Command name="update customer"
+        SQL="update CUSTOMER set LASTNAME = 'Pavick' where ID = ?"
+        kind="Update">
+    </Command>  
+
+</Config>
+
+
+ +

Another way to perform the same operations is through use of SDO DataObjects. For this, the root DataObject needs to be formed either in static (DataObjectModel) or dynamic way (using Database Query's ResultSetMetaData). With the root DataObject in place, it uses, SDO APIs for DataObject and ChangeSummary to perform create, delete, update. For more details check (WorkingWithBasicCrud).

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