Try OpenEdge Now
skip to main content
Online Help
Data Object overview : Tasks : Working with Data Objects : Defining Data Object resources : Creating a Business Entity class : Creating a Business Entity class from the schema file
 
Creating a Business Entity class from the schema file
To create a Business Entity class from the schema of a selected source file:
1. Select an OpenEdge Data Object project and select New Business Entity from the context menu.
The Create a Business Entity class page of New Business Entity wizard appears.
2. Specify values for the controls on the Create a Business Entity class page. See Create a Business Entity class page for detailed information about each control.
3. Click Next.
The Select a schema file page appears.
4. The Resource name field displays the name specified in the Business Entity name field. You can enter a different name. This is an alias of Business Entity class name.
5. Select the operation as Read-only, CRUD, or CRUD and Submit. The ABL code is generated with the specified operations.
6. Select Write dataset before image, if you want the before-image data written to the file.
Note: The Write dataset before image option is selected by default if the CRUD and Submit option is selected. The before-image data is required to perform the Submit operation.
7. Select the Select Schema from file option.
8. In the Schema file field, specify a schema for the defined Business Entity class by clicking Browse and selecting a schema file. The schema can be either a temp-table or a dataset.
Note: If you select a schema file from your current workspace, only the relative path of the project is displayed in the Schema file field. If the selected schema file is from outside your workspace, then the absolute path is displayed. If a schema file is not selected, the Business Entity class file is generated with a default dataset and a single temp-table.
9. The Schema field displays a list of all the temp-tables and datasets of the selected file; select the required temp-table or dataset.
10. Select one of the following options:
*Include file: Select this option if the selected schema file is an include (.i) file. If the selected schema file is an include file, then it is included in the Business Entity class file.
If the Include file option is selected, the Business Entity class file is created by including the selected file. No annotations are generated for the temp-table defined in the selected file.
*Schema definition: Select this option to copy the selected schema definition to a Business Entity class file. This option is enabled if the selected schema file is a procedure (.p or .w), a class (.cls), or an include (.i) file.
If the Schema definition option is selected and the selected file is an include file, the wizard adds the temp-table schema definition from the selected file to the new Business Entity class file along with annotations if the include file does not already have any annotations. In this case, the annotations are generated based on the temp-table definition. If the include file already has annotations then no additional annotations are added.
*Class hierarchy: Select this option if you want to select the schema definition from class hierarchy.
11. Select Expose as Data Object Service to expose the defined Business Entity class as a Data Object resource.
12. Specify a Uniform Resource Identifier (URI) to access the Data Object resource in the Resource URI field. By default, the resource name is displayed in the field with a prefix "/". You can enter a different URI name.
13. Click Finish.
The wizard creates and opens the Business Entity class, which includes the temp-table definition with the Data Object interface (described in the Data Service Catalog) annotations defining the scheme attributes, in the ABL Editor.
Note: You can manually edit or add annotations to the Business Entity class. For more information about these annotations, see Data Service Catalog schema properties.
The wizard also generates a Data Object resource from the Business Entity class file. By default, the defined Business Entity class files are listed under the AppServer node in your project directory.
Note: When you add a Business Entity class file to a non-Data Object project such as OpenEdge or AppServer project, the Data Object facet gets enabled for the project. The project behaves as a Data Object project using which you can develop Data Object applications. The Project Facets page (select Properties > Project Facets on the project context menu) displays the facets associated with your current project. For more information, see Facets page.