Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.javatools.db
Class IDPolicy

java.lang.Object
  extended by oracle.javatools.db.IDPolicy
Direct Known Subclasses:
IDPolicy.DefaultIDPolicy, IDPolicy.SameIDPolicy, IDPolicy.TemporaryIDPolicy

public abstract class IDPolicy
extends java.lang.Object

When a DBObject is copied, the copy can optionally use an IDPolicy. An IDPolicy is responsible for managing the IDs of the copied object. Some example policies subclasses are provided, for example:

After a copy, the Map of original IDs to IDs in the copy is available from the policy.

Since:
11

Nested Class Summary
static class IDPolicy.DefaultIDPolicy
          IDPolicy that creates a TemporaryObjectID that does NOT point back to the original object for every object that has an ID.
static class IDPolicy.SameIDPolicy
          IDPolicy that simply copies the objects ID to the copy.
static class IDPolicy.TemporaryIDPolicy
          IDPolicy that creates a TemporaryObjectID for every object that has the original object set.
 
Constructor Summary
IDPolicy()
           
 
Method Summary
protected  void copyID(DBObject original, DBObject copy)
          The copyTo implementation on DBObject calls this method to create an ID for the copy, and set it.
 java.util.Map<DBObjectID,DBObjectID> getIDMap()
          Returns the mapping of original IDs to new IDs for the copy process.
protected abstract  DBObjectID getNewID(DBObject original, DBObject copy)
          Given the original object, the copy is given an ID depending on the policy.
 java.util.Map<DBObjectID,DBObjectID> getReverseIDMap()
          Returns the mapping of new IDs to the original object IDs for the copy process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDPolicy

public IDPolicy()
Method Detail

copyID

protected final void copyID(DBObject original,
                            DBObject copy)
The copyTo implementation on DBObject calls this method to create an ID for the copy, and set it. This in turn delegates to getNewID to set the appropriate ID, and then maps the new ID internally.

Parameters:
original -
copy -

getNewID

protected abstract DBObjectID getNewID(DBObject original,
                                       DBObject copy)
Given the original object, the copy is given an ID depending on the policy.


getIDMap

public final java.util.Map<DBObjectID,DBObjectID> getIDMap()
Returns the mapping of original IDs to new IDs for the copy process.


getReverseIDMap

public final java.util.Map<DBObjectID,DBObjectID> getReverseIDMap()
Returns the mapping of new IDs to the original object IDs for the copy process.


Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

Copyright © 1997, 2009, Oracle. All rights reserved.