required property

The required property, @openapi.openedge.entity.required, specifies the mandatory fields of an entity. It indicates whether a field can have a null value (unknown value in ABL or undefined in JSON).

In ABL, there is no temp-table support to specify whether or not a field is mandatory. So, the annotations for required fields are obtained from the database table definition when you generate a Business Entity class file from an express Data Object project or from a database table in the New Business Entity wizard.

Sample required annotation:

@openapi.openedge.entity.required (fields="HealthCare,MedicalSpending").

    DEFINE TEMP-TABLE ttBenefits BEFORE-TABLE bttBenefits
    FIELD HealthCare       AS CHARACTER LABEL "Health Care"
    FIELD MedicalSpending  AS INTEGER   INITIAL "0" LABEL "Medical Spending"
    FIELD StockPurchase    AS INTEGER   INITIAL "0" LABEL "Stock Purchase"
    FIELD XTZDEPENDENTCARE AS INTEGER   INITIAL "0" LABEL "Dependent Care"
    INDEX EmpNo IS PRIMARY UNIQUE EmpNum DESCENDING
 
The required annotation is added at the entity level to avoid a large number of annotations being added to a temp-table. But, when generating the Data Service Catalog, the required property is added at the field level.