In writing up some documentation around the use of the RDB DAS with Static Types I noticed something a bit clunky. Here is a current exampleout of the RDB DAS test suite:

   public void testUserProvidedModel() throws SQLException {

       *SDOUtil.registerStaticTypes(CustomerFactory.class);*

DAS das = DAS.FACTORY.createDAS(*getConfig("staticCustomerOrder.xml")*, getConnection());
       Command select = das.getCommand("Customer and Orders");
       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);

   }

What seems clunky is that the the user must specify the Types to the DAS in the config file ("staticCustomerOrder.xml") and also register the Types with the SDO runtime via: *"SDOUtil.registerStaticTypes(CustomerFactory.class)"* It might make sense for the DAS to register the Types based on the confg info as a convienience for the user.

Any thoughts?

--
Kevin
*
*


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to