MBOs with Complex Types

Mobile business objects are mapped to classes containing data and methods that support synchronization and data manipulation. You can develop complex types that support interactions with backend data sources such as SAP® and Web services. When you define an MBO with complex types, Sybase Unwired Platform generates one class for each complex type.

Using a complex type to create an MBO instance.

  1. Suppose you have an MBO named SimpleCaseList and want to use a complex data type called AuthenticationInfo to its Create method's parameter. Begin by creating the complex datatype:
    AuthenticationInfo authen = new AuthenticationInfo();
    authen.setUserName("Demo");
  2. Instantiate the MBO object:
    SimpleCaseList newCase = new SimpleCaseList();
    newCase.setCase_Type("Incident");
    newCase.setCategory("Networking");
    newCase.setCreate_Time(new java.sql.Timestamp(System.currentTimeMillis()));
  3. Call the create method of the SimpleCaseList MBO with the complex type parameter as well as other parameters, and call submitPending() to submit the create operation to the operation replay record. Subsequent synchronizations upload the operation replay record to the Unwired Server and get replayed.
      
    
    newCase.create(authen, "Other", "Other", "Demo", “false”, “worklog”);
    newCase.submitPending();
Related concepts
Accessing MBO Data
Related reference
Query APIs