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 "WorkingWithStaticDataObjects" by KevinWilliams
Date Mon, 30 Oct 2006 21:25:23 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/WorkingWithStaticDataObjects

------------------------------------------------------------------------------
  
  It is not necessary to specify any sort of mapping between database column data types and
your Property data types. If the data types do not match, a conversion will be made between
the two when the property is set on the SDO model. The possible data type conversions are
specified in the SDO specification. If there is no valid conversion available between the
two data types, you can specify a Converter (see WorkingWithColumnConverters) that the DAS
will use to convert the data before setting the value in the !DataObject. 
  
+ The following example demostrates the RDB DAS wih Static SDO Types:
+ {{{
+    DAS das = DAS.FACTORY.createDAS(getConfig("staticCustomerOrder.xml"), getConnection());
+ 
+    Command select = das.getCommand("Customer and Orders");
+ 
+    SDOUtil.registerStaticTypes(CustomerFactory.class);
+ 
+    select.setParameter(1, Integer.valueOf(1));
+ 
+    DataObject root = select.executeQuery();
+ 
+    // Modify a customer
+    Customer customer = (Customer) root.getDataObject("Customer[1]");
+    customer.setLastName("Pavick");
+ 
+    // Modify an order
+    AnOrder order = (AnOrder) customer.getOrders().get(0);
+    order.setProduct("Kitchen Sink 001");
+ 
+    // Flush changes
+    das.applyChanges((DataObject) root);
+ }}}
+ 

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


Mime
View raw message