Object Queries

Object queries are SQL statements associated with a mobile business object (MBO), that returns a subset of a result set. For example, an object query is used to filter downloaded data to display a single row of a table when triggered.

Define object queries to return a subset of MBO results, either from an MBO deployed to Unwired Server or a local business object.

Object query usage
MBO type Usage
Not bound to a data source (local business object) The requested data must be available on the mobile device. If not, another (syncable) MBO must trigger a synchronization to download the requested data. The query can then continue to return data from the client's local database.
Bound to a data source
  1. Create the query.
  2. Call the query from the device application at runtime to display a subset of the results on the device.
Contained in a cache group that uses an Online policy

MBOs that use an Online cache group policy generate one, read-only object query named findByParameter, which is automatically generated by Unwired WorkSpace. findByParameter query parameter(s) are generated for every load parameter that has a Propagate to attribute. The findByPrimaryKey object query and any other user defined object queries are removed for MBOs that use an Online cache policy.

By default the return type is Return multiple objects and Create an index is true, and these are the only values you can modify.

If you modify a Propagate To attribute of a load parameter belonging to an MBO using an Online cache group policy, the object query is automatically updated.