kony.sdk.dto.SelectQuery Class

This class is used to construct a database query. An instantiation of this class is used as the query object which is passed into the setSelectQueryObject method of a kony.sdk.dto.DataObject Class object.

NOTE: This class is used only for offline Object Services, not for online Object Services.

Constructors

The kony.sdk.dto.SelectQuery class has one constructor.

SelectQuery(objectServiceName, recordObject)

Parameter Type Description
objectServiceName string Name of object service defined in the application
recordObject kony.sdk.dto.Table Specifies the table on which the query is to be run

Methods

addColumn(columnObject)

Signature

addColumn(columnObject)

Parameters

Parameter Type Description
columnObject kony.sdk.dto.Column Defines the column information

Example

 // **Creation of SelectQuery object for one table**
  var dataObject = new kony.sdk.dto.DataObject("EAM_WO_ATTACHMENT");
  var tblDto = new kony.sdk.dto.Table("EAM_WO_ATTACHMENT", null, false);
  var selQuery = new kony.sdk.dto.SelectQuery(objServiceName, tblDto);
  var colObj = new kony.sdk.dto.Column(tblDto, "ORDER_NUM");
  var colObj2 = new kony.sdk.dto.Column(tblDto, "BINARY_NAME");
  var colObj3 = new kony.sdk.dto.Column(tblDto, "ATTACH_DESC");
  selQuery.addColumn(colObj);
  selQuery.addColumn(colObj2);
  selQuery.addColumn(colObj3);

  dataObject.setSelectQueryObject(selQuery);

The selectQuery object described above is similar to the SQL instruction:

 Select ORDER_NUM,BINARY_NAME,ATTACH_DESC from EAM_WO_ATTACHMENT