Inherited description: This callback method is invoked by the %New() method to
provide notification that a new instance of an object is being created.
If this method returns an error then the object will not be created.
It is passed the arguments provided in the %New call.
When customizing this method, override the arguments with whatever variables and types you expect to receive from %New().
For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:
Method %OnNew(dob as %Date = "", name as %Name = "") as %Status
If instead of returning a %Status code this returns an oref and this oref is a subclass of the current
class then this oref will be the one returned to the caller of %New method.
%Prepare()
This method is different for each type of result set class. This method has two tasks. First, instantiate the correct
concrete result set class. Think of the first parameter, queryId, as being an "index key value" that is used to lookup
the correct query implementation. For non-cached (static) queries this is simply the name of the class that implements
the query, i.e. the %IResultSet interface. The second task is to prepare the resulting object for data
retrieval by the caller which is done in %OnNew. The assumption is that if the query requires any parameters
then the actual arguments are all literal or public variables.
queryId the concrete subclass of %IResultSet that implements the desired query. For dynamic cached results this value
is generally the query text that can be parsed, a hashed value computed and the cached result implementation class
looked up in the query cache index.
%returnError If an error occurs this is returned by reference and is a %SYSTEM.Error object
with properties set to describe information about the error
%importPackages This is a comma delimited list of packages to import. This is only relevant if the result set implementation is
generated and the query source might include unqualified names. The import packages list is used to resolve package/schema names for
unqualified names.
%PrepareMetaData is similar to %Prepare except that no result set is instantiated. This
method returns a %ResultSet.MetaData object. Be aware that the implementation of this
method might cause the result set to be instantiated but that is up to the result set
class itself and no result set is actually returned by this method - only metadata.
class This is the custom result set class
returnError If an error occurs this is returned by reference and is a %SYSTEM.Error object
with properties set to describe information about the error. %returnError.Status contains the %Status value.
importPackages This is a comma delimited list of packages to import. This is only relevant if the result set implementation is
generated and the query source might include unqualified names. The import packages list is used to resolve package/schema names for
unqualified names.