Retrieving Relationship Data

A relationship between two MBOs allows the parent MBO to access the associated MBO.

Assume there are two MBOs defined in Unwired Server. One MBO is called Customer and contains a list of customer data records. The second MBO is called SalesOrder and contains order information. Additionally, assume there is an association between Customers and Orders on the customer ID column. The Orders application is parameterized to return order information for the customer ID.

Customer customer = Customer.findById (101);
com.sybase.collections.ObjectList orders =
customer.getSalesOrders();

You can also use the Query class to filter the return MBO list data.

Query props = new Query();
// set query parameters
......
com.sybase.collections.ObjectList orders =
customer.getSalesOrdersFilterBy(props);