Try OpenEdge Now
skip to main content
OpenEdge 11.6.1 New Information : OpenEdge Data Objects: Documentation Update
 

OpenEdge Data Objects: Documentation Update

In the OpenEdge 11.6 release of OpenEdge Development: Web Services, Chapter 6, "Data Object Services," Table 11, "Sample Business Entity class for a Data Object resource with before-image support," in the "Sample Business Entity with before-image support" topic contains errors in the sample code. These errors occur in the Business Entity method definitions that implement Data Object CRUD and Submit operations, each of which calls a corresponding super class method to implement the supported operation. However, instead of calling the corresponding super class method by its correct name, the method name that the definition invokes is identical to the name of the calling Business Entity method, which has a different name from the super class method.
For example, the definition for the Business Entity method, ReaddsCustomer( ), incorrectly calls ReaddsCustomer( ) as its implementing super class method instead of calling ReadData( ).
The following table reproduces the Table 11 sample code from the documentation, with the incorrectly specified method names shown in bold.
Table 5. Sample Business Entity class with incorrect super class method names shown in bold
USING Progress.Lang.*.
USING OpenEdge.BusinessLogic.BusinessEntity.


BLOCK-LEVEL ON ERROR UNDO, THROW.


CLASS Customer INHERITS BusinessEntity:

{"customer.i"}

DEFINE DATA-SOURCE srcCustomer FOR Customer.

CONSTRUCTOR PUBLIC Customer():

DEFINE VAR hDataSourceArray AS HANDLE NO-UNDO EXTENT 1.
DEFINE VAR cSkipListArray AS CHAR NO-UNDO EXTENT 1.

SUPER(DATASET dsCustomer:HANDLE).

/* Data Source for each table in dataset. Should be in table order
as defined in DataSet. */
hDataSourceArray[1] = DATA-SOURCE srcCustomer:HANDLE.

/* Skip-list entry for each table in dataset. Should be in temp-table order
as defined in DataSet. Each skip-list entry is a comma-separated list of
field names, to be ignored in the ABL CREATE statement. */
cSkipListArray[1] = "CustNum".

THIS-OBJECT:ProDataSource = hDataSourceArray.
THIS-OBJECT:SkipList = cSkipListArray.

END CONSTRUCTOR.


METHOD PUBLIC VOID ReaddsCustomer(INPUT filter AS CHARACTER, OUTPUT DATASET dsCustomer):

SUPER:ReaddsCustomer(filter).

END METHOD.


METHOD PUBLIC VOID CreatedsCustomer(INPUT-OUTPUT DATASET dsCustomer):

DEFINE VAR hDataSet AS HANDLE NO-UNDO.
hDataSet = DATASET dsCustomer:HANDLE.

SUPER:CreatedsCustomer(DATASET-HANDLE hDataSet BY-REFERENCE).

END METHOD.


METHOD PUBLIC VOID UpdatedsCustomer(INPUT-OUTPUT DATASET dsCustomer):

DEFINE VAR hDataSet AS HANDLE NO-UNDO.
hDataSet = DATASET dsCustomer:HANDLE.

SUPER:UpdatedsCustomer(DATASET-HANDLE hDataSet BY-REFERENCE).

END METHOD.


METHOD PUBLIC VOID DeletedsCustomer(INPUT-OUTPUT DATASET dsCustomer):

DEFINE VAR hDataSet AS HANDLE NO-UNDO.
hDataSet = DATASET dsCustomer:HANDLE.

SUPER:DeletedsCustomer(DATASET-HANDLE hDataSet BY-REFERENCE).

END METHOD.


METHOD PUBLIC VOID SubmitdsCustomer(INPUT-OUTPUT DATASET dsCustomer):

DEFINE VAR hDataSet AS HANDLE NO-UNDO.
hDataSet = DATASET dsCustomer:HANDLE.

SUPER:SubmitdsCustomer(DATASET-HANDLE hDataSet BY-REFERENCE).

END METHOD.

END CLASS.
The following table shows the same sample code from Table 11 with the correctly specified method names shown in bold.
Table 6. Sample Business Entity class with the corrected super class method names shown in bold
USING Progress.Lang.*.
USING OpenEdge.BusinessLogic.BusinessEntity.


BLOCK-LEVEL ON ERROR UNDO, THROW.


CLASS Customer INHERITS BusinessEntity:

{"customer.i"}

DEFINE DATA-SOURCE srcCustomer FOR Customer.

CONSTRUCTOR PUBLIC Customer():

DEFINE VAR hDataSourceArray AS HANDLE NO-UNDO EXTENT 1.
DEFINE VAR cSkipListArray AS CHAR NO-UNDO EXTENT 1.

SUPER(DATASET dsCustomer:HANDLE).

/* Data Source for each table in dataset. Should be in table order
as defined in DataSet. */
hDataSourceArray[1] = DATA-SOURCE srcCustomer:HANDLE.

/* Skip-list entry for each table in dataset. Should be in temp-table order
as defined in DataSet. Each skip-list entry is a comma-separated list of
field names, to be ignored in the ABL CREATE statement. */
cSkipListArray[1] = "CustNum".

THIS-OBJECT:ProDataSource = hDataSourceArray.
THIS-OBJECT:SkipList = cSkipListArray.

END CONSTRUCTOR.


METHOD PUBLIC VOID ReaddsCustomer(INPUT filter AS CHARACTER, OUTPUT DATASET dsCustomer):

SUPER:ReadData(filter).

END METHOD.


METHOD PUBLIC VOID CreatedsCustomer(INPUT-OUTPUT DATASET dsCustomer):

DEFINE VAR hDataSet AS HANDLE NO-UNDO.
hDataSet = DATASET dsCustomer:HANDLE.

SUPER:CreateData(DATASET-HANDLE hDataSet BY-REFERENCE).

END METHOD.


METHOD PUBLIC VOID UpdatedsCustomer(INPUT-OUTPUT DATASET dsCustomer):

DEFINE VAR hDataSet AS HANDLE NO-UNDO.
hDataSet = DATASET dsCustomer:HANDLE.

SUPER:UpdateData(DATASET-HANDLE hDataSet BY-REFERENCE).

END METHOD.


METHOD PUBLIC VOID DeletedsCustomer(INPUT-OUTPUT DATASET dsCustomer):

DEFINE VAR hDataSet AS HANDLE NO-UNDO.
hDataSet = DATASET dsCustomer:HANDLE.

SUPER:DeleteData(DATASET-HANDLE hDataSet BY-REFERENCE).

END METHOD.


METHOD PUBLIC VOID SubmitdsCustomer(INPUT-OUTPUT DATASET dsCustomer):

DEFINE VAR hDataSet AS HANDLE NO-UNDO.
hDataSet = DATASET dsCustomer:HANDLE.

SUPER:SubmitData(DATASET-HANDLE hDataSet BY-REFERENCE).

END METHOD.

END CLASS.
Note: When Progress Developer Studio for OpenEdge generates a default Business Entity class for a selected database table as the data source for a Data Object resource with before-image support, it generates the correct super class method names in the source code. The incorrect method names appear only in the current documentation sample.