Skip Headers
Oracle TopLink Developer's Guide
10g Release 3 (10.1.3)
B13593-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
 

Configuring Copy Policy

The TopLink unit of work feature must be able to produce an exact copy (clone) persistent objects. Table 28-32 summarizes which descriptors support a copy policy.

Table 28-32 Configuring Descriptors with a Copy Policy

Descriptor Using TopLink Workbench
Using Java

Relational Descriptors

Supported.


Supported.


Object-Relational Descriptors

Unsupported.


Supported.


EIS Descriptors

Supported.


Supported.


XML Descriptors

Supported.


Supported.



TopLink supports two ways of copying objects:

Using TopLink Workbench

To specify the copy policy for a descriptor, use this procedure:

  1. Select a descriptor in the Navigator. Its properties appear in the Editor.

    If the Copying advanced property is not visible for the descriptor, right-click the descriptor and choose Select Advanced Properties > Copying from the context menu or from the Selected menu.

  2. Click the Copying tab in the Editor.

    Figure 28-41 Copying Tab

    Copying tab

Use the following information to enter data in each field on the tab:

Field Description
Use Instantiation Policy Creates a new instance of the object using the descriptor's instantiation policy (see "Configuring Instantiation Policy").
Use Clone Method Specifies whether or not to call the clone method of the object. Select a method from the list.

Using Java

Use one of the following ClassDescriptor methods to set the appropriate type of copy policy:

  • useCloneCopyPolicy(): the object must provide a clone method

  • useCloneCopyPolicy(java.lang.String cloneMethodName)

  • useInstantiationCopyPolicy()