Skip Headers
Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2)
Part No. B15900-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Working with Instantiation Policy

OracleAS TopLink supports several ways to instantiate objects:

You can use custom Java code to override the instantiation policy. Refer to the Oracle Application Server TopLink Application Developer's Guide for details.

Setting Instantiation Policy

Use the Instantiation tab to specify if objects are instantiated by the default constructor, a specific method, or a factory.

To set the instantiation policy:

  1. In the Navigator pane, select a descriptor.

    If the Instantiation advanced property is not visible for the descriptor, right-click the descriptor and choose Set Advanced Properties > Instantiation from the pop-up menu or from the Selected menu.

  2. Click the Instantiation tab.

    Figure 4-34 Instantiation Tab

    Description of instant.gif follows
    Description of the illustration instant.gif

  3. Use this table to enter data in each field:

Field Description
Use Default Constructor The default constructor of the class instantiates a new instance.
Use Method Specify a Method to execute to create objects from the database.
Method Name of a method to be executed to create objects from the database. The method must be a public, static method on the descriptor's class and must return a new instance of the object.
Use Factory Refer to the Oracle Application Server TopLink Application Developer's Guide for more information.
Factory Class The class of the factory object that creates the new instances.
Factory Method The message to be sent to obtain a factory object. Choose <nothing> to use the default constructor.
Instantiation Method The method to be sent to the factory object to obtain a new instance that will be populated with data from the database.