Defining the Mobile Business Object

Create an MBO with the required attributes, assign the MBO to a cache group that uses a Scheduled policy, and define an object query that returns the results from the Unwired Server cache (also called the CDB) to the client.

This example defines an MBO that retrieves employee benefit information for all employees of a given department based on the dept_id attribute using the findByDeptId object query.
  1. From Unwired WorkSpace, create an MBO. For example, you could define the employee MBO as:
    SELECT   emp_id,
      emp_fname,
      emp_lname,
      dept_id,
      bene_health_ins,
      bene_life_ins,
      bene_day_care
      FROM sampledb.dba.employee
    
    
  2. Set the cache group policy for the MBO:
    1. Create a new cache group named CacheGroupScheduled and set the policy to Scheduled. Set the Cache interval to 24 hours, so the cache is refreshed once a day.


    2. Drag and drop the MBO to CacheGroupScheduled.
  3. Define an object query for the MBO that retrieves employee information based on the dept_id attribute. For example, define the findByDeptId object query as:
    SELECT x.* FROM Employee x
    WHERE x.dept_id = :deptIDLP



  4. Deploy the project that contains the MBO to Unwired Server. Select Message-based in the deployment wizard.