Retrieving Relationship Data

A relationship between two MBOs allows the parent MBO to access the associated MBO. If the relationship is bi-directional, it also allows the child MBO to access the associated parent 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 SalesOrder on the customer ID column. The Orders application is parameterized to return order information for the customer ID.

Customer customer = Customer.FindByPrimaryKey(101);
            Sybase.Collections.GenericList<SalesOrder> orders = customer.Orders;

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

Query props = new Query();
… // set query parameters
Sybase.Collections.GenericList<SalesOrder> orders = customer.GetOrdersFilterBy(props);