2016/05/28 - Apache Tuscany has been retired.

For more information, please explore the Attic.

 
 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