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 a database table
 
Creating a Business Entity class from a database table
To create a Business Entity class from a selected database table:
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 database table option button to select a database connection and table.
a. In the Connection field, select the database connection that you want to use to dynamically define the temp-table.
b. In the Table field, select the database table from selected database connection.
8. Select Expose as Data Object Service to expose the defined Business Entity class as a Data Object resource.
Note: This generates default Data Object interface annotations to define a Business Entity as a Data Object resource.
9. 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.
10. 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 JSDO Data Service 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 except ABL Web App 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 Services. 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 Facet page.