Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Although the RDBDAS default behavior is to produce graphs of dynamic DataObjects (see ResultSetDrivenDataObjectTypes), the DAS allows users to work with Static DataObjects as well.

...

To map these database tables and columns to your SDO types and properties, you can provide a "Type Name" and "Property Name" (see WorkingWithNameMapping). In the above example, if we specify a Type name of "employee", the DAS will attempt to create DataObject instances of type "employee" from the information in the BANK_EMPLOYEE table.

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.

...

// 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);

Panel

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();

Wiki Markup

...