DEFINE NEW SHARED PRIVATE PROTECTED STATICDATASET dataset-nameNAMESPACE-URI namespace NAMESPACE-PREFIX prefixXML-NODE-NAME node-name SERIALIZE-NAME serialize-nameXML-NODE-TYPE node-type SERIALIZE-HIDDENREFERENCE-ONLY FOR buffer-name , buffer-nameDATA-RELATION data-rel-name FOR data-rel-specPARENT-ID-RELATION data-rel-name FOR parent-id-rel-specNEW SHARED DATASET dataset-nameDefines and identifies a ProDataSet object that can be shared by one or more procedures called directly or indirectly by the current procedure. The ProDataSet object remains available to other procedures until the procedure that defined it ends. The called procedures must define the same ProDataSet object name as SHARED. For shared ProDataSet objects, each buffer-name must be the name of a shared buffer.SHARED DATASET dataset-nameDefines and identifies a ProDataSet object that was initially defined by another procedure as NEW SHARED. For shared ProDataSet objects, each buffer-name must be the name of a shared buffer.dataset-namePRIVATE PROTECTED STATIC DATASETDefines and identifies a ProDataSet object as a data member of a class, and optionally specifies an access mode (PRIVATE or PROTECTED) and scope (instance or STATIC) for that data member. You cannot specify any of these options for a ProDataSet defined in an interface type definition (INTERFACE statement block) or when defining a ProDataSet as a data element of a procedure. For a data member ProDataSet, each buffer-name must be the name of a compatible data member buffer (see the FOR option).
Note: The specified options are applicable only when defining a data member for a class in a class definition (.cls) file. You cannot shadow (override) the definition of a given ProDataSet data member in a class hierarchy.For more information on accessing ProDataSets of different access modes and scopes, see the reference entry for Class-based data member access.For more information on where and how to define data members in a class, see the CLASS statement reference entry.DATASET dataset-nameNAMESPACE-URI namespaceNAMESPACE-PREFIX prefixXML-NODE-NAME node-nameAn optional CHARACTER constant that specifies the name of the XML element representing the ProDataSet in an XML Document. The default is dataset-name. Use this option when the serialized name either contains invalid characters for an ABL name or the serialized name is an ABL keyword.XML-NODE-TYPE node-typeAn optional CHARACTER constant that specifies the XML node type of the ProDataSet element represented in XML. The valid option values are "ELEMENT" and "HIDDEN". The default value is "ELEMENT".This will support the WRITE-JSON( )and WRITE-XML( ) methods in case the root of the JSON string or XML document maps to a temp-table. For XML, the XML-NODE-TYPE attribute takes precedence over SERIALIZE-HIDDEN attribute.SERIALIZE-NAME serialize-nameAn optional CHARACTER constant that specifies the name of the ProDataSet as it should appear when serialized, for example into JSON or XML. The default is dataset-name. Use this option when the serialized name either contains invalid characters for an ABL name or the serialized name is an ABL keyword.Specifies the name of compile-time defined temp-table buffer that is scoped to the procedure or class in which the ProDataSet object is defined. For a shared ProDataSet, each buffer-name must be a shared buffer. If the ProDataSet is a data member of a class, you must specify the name of a compatible buffer data member. Thus, if the ProDataSet is a static data member, the buffer must also be a static data member; if the ProDataSet is PROTECTED, the buffer must also be defined as PROTECTED or inherited from a super class; and if the ProDataSet is PRIVATE, the buffer can be defined as either PRIVATE or PROTECTED. If the ProDataSet is a PRIVATE instance data member, you can also specify a default database table buffer; you cannot specify a default database buffer for a ProDataSet data member defined with any other combination of access mode and scope.The data-rel-name argument lets you name the data-relation object. You can use this name to obtain the object’s handle at run time. This argument is optional. The default name is Relationn (where n starts at 1 for each ProDataSet object).The data-rel-spec argument specifies a pair of parent and child buffers for the data-relation object using the following syntax:
parent-buffer-name, child-buffer-name field-mapping-phraseREPOSITION NESTED FOREIGN-KEY-HIDDEN NOT-ACTIVERECURSIVEThe parent buffer in the data-relation object. This must be one of the buffers identified by buffer-name.The child buffer in the data-relation object. This must be one of the buffers identified by buffer-name.
RELATION-FIELDS ( parent-field1 , child-field1, parent-fieldn , child-fieldn )You can define a query for the data source of the child buffer, or supply custom logic in response to FILL events that take over complete responsibility for filling one level of the ProDataSet object. In these cases, the field-mapping-phrase is not used.An optional argument that lets you name the data-relation. You can use this name to obtain the PARENT-ID-RELATION’s handle at run time. The default value is Relationn (where n starts at 1 for each ProDataSet).Specifies a pair of parent and child buffers for the PARENT-ID-RELATION, the RECID field in the child buffer, and the XML and JSON serialization order for parent record fields using the following syntax:
parent-buffer-name, child-buffer-name PARENT-ID-FIELD id-fieldPARENT-FIELDS-BEFORE ( parent-field1 , parent-field2 )PARENT-FIELDS-AFTER ( parent-field1 , parent-field2 )Specifies the name of the parent buffer in PARENT-ID-RELATION. This is one of the buffers identified by buffer-name.Specifies the child buffer in PARENT-ID-RELATION. This is one of the buffers identified by buffer-name.PARENT-ID-FIELD id-fieldSpecifies the RECID field in child-buffer-name. When writing records from the parent-buffer-name temp-table to XML or JSON, child-buffer-name records whose id-field’s value is equal to the RECID of the parent record will be nested within the parent record’s XML node or JSON string.An optional phrase that specifies the fields from the parent-buffer-name temp-table record that are to be written to XML before any child-buffer-name temp-table records.An optional phrase that specifies the fields from the parent-buffer-name temp-table record that are to be written to XML after all child-buffer-name temp-table records.When neither PARENT-FIELDS-BEFORE or PARENT-FIELDS-AFTER are specified, the default behavior is to write all the fields from the parent record to XML before any nested child records.If a PARENT-ID-RELATION contains PARENT-FIELDS-BEFORE or PARENT-FIELDS-AFTER, then all the fields from the parent buffer that have XML-NODE-TYPE as ELEMENT must be listed among the PARENT-ID-RELATIONs containing the buffer as parent-buffer-name. Else, the AVM raises a compiler error. The compiler also checks for duplicate entries.
PARENT-FIELDS-BEFORE is only allowed on the first PARENT-ID-RELATION for parent-buffer-name. If PARENT-FIELDS-BEFORE appears in a subsequent PARENT-ID-RELATION for parent-buffer-name, the AVM raises a compiler error.
A ProDataSet defined with the PARENT-ID-RELATION option cannot be passed as a parameter to a procedure or user-defined function that defines an OpenEdge Web service. If you do, ProxyGen fails.For examples of ProDataSet definitions and usage, see OpenEdge Development: ProDataSets.For examples of instance and static ProDataSet data member definitions, see the descriptions of r-CustObj.cls, r-CustObjStatic.cls, and r-CustObjAbstract.cls in the CLASS statement reference entry.
You cannot define a SHARED or NEW SHARED ProDataSet object in a class definition (.cls) file. If you do, ABL generates a compilation error.
A ProDataSet can be compile-time defined (often referred to as a static ProDataSet object), where the ProDataSet is defined and created at compile time using this statement; or it can be run-time defined (often referred to as a dynamic ProDataSet object), where the ProDataSet is defined and created at run time using the CREATE DATASET statement and ProDataSet object handle operations. A compile-time defined ProDataSet can also be defined as a static data member of a class. In this case, it is a static ProDataSet object that is also a class static data member.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |