Home > Class Reference > ENSLIB namespace > %ZEN.Component.querySource
Private  Storage   

%ZEN.Component.querySource


abstract class %ZEN.Component.querySource

This abstract class provides a standard interface for creating a %ResultSet object that a component can then use to supply itself with data.
There are several ways to define the creation of a %ResultSet object:

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
12 3


Summary


Properties
OnCreateResultSet OnExecuteResultSet columnName countRows
groupByClause maxRows orderByClause queryClass
queryName sql tableName whereClause

Methods
%CreateResultSet %OnCreateResultSet %OnExecuteResultSet

Subclasses
%ZEN.Auxiliary.altJSONSQLProvider %ZEN.Auxiliary.jsonSQLProvider %ZEN.Component.dataCombo
%ZEN.Component.dataListBox %ZEN.Component.repeatingGroup %ZEN.Component.simpleTablePane

Properties


• property OnCreateResultSet as %ZEN.Datatype.delegator(FORMALSPEC="*tSC:%Status,pInfo:%ZEN.Auxiliary.QueryInfo",RETURNTYPE="%ResultSet");
(optional) Name of Server-side callback method to call to create a %ResultSet object.
This must be the name of a server-only method in the page class that contains this component.
• property OnExecuteResultSet as %ZEN.Datatype.delegator(FORMALSPEC="pRS:%Library.ResultSet,*tSC:%Status,pInfo:%ZEN.Auxiliary.QueryInfo",RETURNTYPE="%Boolean");
(optional) Name of Server-side callback method to call to execute the %ResultSet object.
This must be the name of a server-only method in the page class that contains this table pane.
• property columnName as %ZEN.Datatype.string(ZENEXPRESSION=1);
(optional) Name of a column in the SQL table used to provide data.
If both this and tableName is specified, and no other columns are defined, then an automatically generated query will use %ID for the value column and the column specified by columnName for the display value.
This must contain a valid column name.
• property countRows as %ZEN.Datatype.integer [ InitialExpression = 0 ];
This property should not be used; it is provided for backward compatibility. The original implementation of querySource caused the pInfo.rowCount property to be computed automatically, however this was never used and in cases where a table did not have an extent bitmap index would cause poor performance. To get the original behavior set this to 1 (true).
• property groupByClause as %ZEN.Datatype.string(ZENEXPRESSION=1);
(optional) An SQL GROUP BY clause: e.g., "Year,State"
For sources that automatically create an SQL statement, this is used to create a GROUP BY clause.
• property maxRows as %ZEN.Datatype.integer [ InitialExpression = 100 ];
Maximum number of rows to fetch from the %ResultSet object. This provides a way to limit the number of rows displayed by a data-aware component.
If this is set to 0, then no limit is enforced; all rows from the query are displayed.
• property orderByClause as %ZEN.Datatype.string(ZENEXPRESSION=1);
(optional) An SQL ORDER BY clause: e.g., "Name,State"
For sources that automatically create an SQL statement, this is used to create the ORDER BY clause.
• property queryClass as %ZEN.Datatype.className(ZENENCRYPT=1);
(optional) Name of the class containing the class query that will be used to create a %ResultSet object.
This is an encrypted value and cannot be modified on the client.
• property queryName as %ZEN.Datatype.classMember(MEMBERTYPE="QUERY");
(optional) Name of the class query that will be used to create a %ResultSet object.
• property sql as %ZEN.Datatype.sql;
(optional) SQL statement that, if present, will be used to create a %ResultSet object.
If defined, this takes precedence over queryClass and queryName.
• property tableName as %ZEN.Datatype.string(ZENENCRYPT=1,ZENEXPRESSION=1);
(optional) Name of an SQL table used to provide data.
For sources that automatically create an SQL statement, this is the table used in the FROM clause.
If no column information is supplied, then the %ID column of the table will be used as the SELECT list.
This value is encrypted and cannot be modified on the client.
• property whereClause as %ZEN.Datatype.string(ZENEXPRESSION=1);
(optional) An SQL WHERE clause: e.g., "Name='Elvis'"
For sources that automatically create an SQL statement, this is used to create the WHERE clause.

Methods


• final method %CreateResultSet(Output tSC As %Status, pInfo As %ZEN.Auxiliary.QueryInfo, pExecute As %Boolean = 1) as %ResultSet
Internal method.
Create and execute the %ResultSet object used to supply data for this component. If pExecute is false, then do not execute the query.
• method %OnCreateResultSet(Output tSC As %Status, pInfo As %ZEN.Auxiliary.QueryInfo) as %ResultSet
Internal method.
Subclasses can override this to create the %ResultSet object used to used by this component.
The default implementation is to call the page method specified by the OnCreateResultSet property, if defined.
• method %OnExecuteResultSet(pRS As %ResultSet, Output tSC As %Status, pInfo As %ZEN.Auxiliary.QueryInfo) as %Boolean
Internal method.
Subclasses can override this to execute the %ResultSet object used to by this component.
Return true (1) if the result set has been executed.
The default implementation is to call the page method specified by the onExecuteResultSet property, if defined.