Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.toplink.sessions
Class ObjectCopyingPolicy

`java.lang.Object
oracle.toplink.sessions.ObjectCopyingPolicy`

public class ObjectCopyingPolicy
extends java.lang.Object

Purpose: Define how an object is to be copied.

Description: This is for usage with the object copying feature, not the unit of work. This is useful for copying an entire object graph as part of the host application's logic.

Responsibilities:

- Inidcate through CASCADE levels the depth relationships will copied.
- Indicate if PK attributes should be copied with existing value or should be reset.

Since:
  TOPLink/Java 3.0
See Also:
  `Session.copyObject(Object, ObjectCopyingPolicy)`

Field Summary
`static int` | `CASCADE_ALL_PARTS` Depth level indicating that all relationships with mappings should be used when building the copied object graph
`static int` | `CASCADE_PRIVATE_PARTS` Depth level indicating that only relationships with mapping indicated privately- owned should be copied
`static int` | `NO_CASCADE` Depth level indicating that NO relationships should be included in the copy.

Constructor Summary
`ObjectCopyingPolicy()` PUBLIC: Return a new copying policy.

Method Summary
`void` | `cascadeAllParts()` PUBLIC: Set if the copy should cascade all relationships when copying the object(s).
`void` | `cascadePrivateParts()` PUBLIC: Set if the copy should cascade only those relationships that are configured as privately-owned.
`void` | `dontCascade()` PUBLIC: Set if the copy should not cascade relationships when copying the object(s)
`void` | `setShouldResetPrimaryKey(boolean newShouldResetPrimaryKey)` PUBLIC: Set if the primary key should be reset to null.
`boolean` | `shouldCascade()` PUBLIC: Return true if the policy has been configured to CASCADE_ALL_PARTS or CASCADE_PRIVATE_PARTS.
`boolean` | `shouldCascadeAllParts()` PUBLIC: Return true if the policy should CASCADE_ALL_PARTS
`boolean` | `shouldCascadePrivateParts()` PUBLIC: Return true if the policy should CASCADE_PRIVATE_PARTS
`boolean` | `shouldResetPrimaryKey()` PUBLIC: Return if the primary key should be reset to null.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### NO_CASCADE

    public static final int NO_CASCADE

  Depth level indicating that NO relationships should be included in the copy. Relationships that are not copied will include the default value of the object's instantiation policy
  See Also:
    Constant Field Values

### CASCADE_PRIVATE_PARTS

    public static final int CASCADE_PRIVATE_PARTS

  Depth level indicating that only relationships with mapping indicated privately- owned should be copied
  See Also:
    Constant Field Values

### CASCADE_ALL_PARTS

    public static final int CASCADE_ALL_PARTS

  Depth level indicating that all relationships with mappings should be used when building the copied object graph
  See Also:
    Constant Field Values

Constructor Detail

### ObjectCopyingPolicy

    public ObjectCopyingPolicy()

  PUBLIC: Return a new copying policy. By default the policy cascades privately owned parts and nulls primary keys.

Method Detail

### cascadeAllParts

    public void cascadeAllParts()

  PUBLIC: Set if the copy should cascade all relationships when copying the object(s).

### cascadePrivateParts

    public void cascadePrivateParts()

  PUBLIC: Set if the copy should cascade only those relationships that are configured as privately-owned.

### dontCascade

    public void dontCascade()

  PUBLIC: Set if the copy should not cascade relationships when copying the object(s)

### setShouldResetPrimaryKey

    public void setShouldResetPrimaryKey(boolean newShouldResetPrimaryKey)

  PUBLIC: Set if the primary key should be reset to null.

### shouldCascade

    public boolean shouldCascade()

  PUBLIC: Return true if the policy has been configured to CASCADE_ALL_PARTS or CASCADE_PRIVATE_PARTS.

### shouldCascadeAllParts

    public boolean shouldCascadeAllParts()

  PUBLIC: Return true if the policy should CASCADE_ALL_PARTS

### shouldCascadePrivateParts

    public boolean shouldCascadePrivateParts()

  PUBLIC: Return true if the policy should CASCADE_PRIVATE_PARTS

### shouldResetPrimaryKey

    public boolean shouldResetPrimaryKey()

  PUBLIC: Return if the primary key should be reset to null.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD