Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2) Part No. B15900-01 |
|
Previous |
Next |
OracleAS TopLink supports several ways to instantiate objects:
By default, the default constructor of the class instantiates a new instance.
If the application requires that objects be instantiated in other ways, the instantiation method can be customized.
You can use custom Java code to override the instantiation policy. Refer to the Oracle Application Server TopLink Application Developer's Guide for details.
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:
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.
Click the Instantiation tab.
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. |