Generating Java Source Files and Methods for Entity Objects

While creating an entity object with the Entity Object Wizard or editing an entity object with the Entity Object Editor, in the Java page, you can specify that the wizard generate a Java file for the entity definition class, the entity object class, or both. By default, the wizard generates the entity object class, but not the entity definition class. You can edit these classes to customize the entity object's behavior through its methods. You can also generate these classes from a customized base class.

The Java page has these fields:

Field

Description

Entity Definition Class

These settings apply to the EntityDefImpl class.

Generate Java file

When this checkbox is selected, JDeveloper generates a Java file you can edit to customize the entity object definition's behavior. Otherwise, JDeveloper generates an XML file only.

If an entity object publishes or subscribes to an event through the Publish or Subscribe pages, this checkbox is automatically set, as most of the event code is generated in the definition files.

Entity Object Class

These settings apply to the EntityImpl class.

Generate Java file

When this checkbox is selected, JDeveloper generates a Java file that you can edit to customize the entity object's behavior. Otherwise, JDeveloper generates an XML file only.

Generate Methods

By default, accessor methods are generated. The others are not.

Accessors

Select this checkbox to generate accessor methods (for example, getJob and setJob).

Data Manipulation methods

Select this checkbox to generate data manipulation methods, including lock, which you can modify to customize the entity object's locking behavior, and doDML, which you can modify to customize its update, insert, and delete logic.

Create method

Select this checkbox to generate a create method, where you can customize or add additional initialization features to the entity object's create logic.

Remove method

Select this checkbox to generate a remove method, where you can customize or add clean-up code to the entity object's remove logic.

Extends

Click Extends to select entity object and definition base classes you want to use to generate the entity object. Typically, in an applications organization, the framework supplied by JDeveloper will be customized by a core group and all entity objects for the organization may be built over this customized framework.

To generate an entity definition class:

  1. Select Generate Java File.

  2. Optionally click Extends if you want to generate this class from a customized framework class.

  3. Click Next or Finish when you are finished with this page.

To generate an entity object class:

  1. Select Generate Java File.

  2. Select the methods you want to generate.

  3. Optionally click Extends if you want to generate this class from a customized framework class.

  4. Click Next or Finish when you are finished with this page.


Related topics
About the EntityDefImpl Class
About the EntityImpl Class

Examples