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

E13403-05

oracle.javatools.db
Class SchemaObjectManager

java.lang.Object
  extended by oracle.javatools.db.CascadeManager
      extended by oracle.javatools.db.SchemaObjectManager

public class SchemaObjectManager
extends CascadeManager

This class is for internal use only. The public API is CascadeManager

Since:
10.1.3
For internal use only. Application developers should not use this

Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.db.CascadeManager
CascadeManager.NoCascadeRequiredException
 
Constructor Summary
SchemaObjectManager(DBObjectProvider provider)
           
 
Method Summary
protected  void checkInit()
          By default this does nothing.
protected  void clearAllCaches()
           
protected  boolean couldFixUnresolvedReferences(DBObject obj)
          If the provider supports unresolved references this method must return for an object that could resolve them.
static SystemObject[] getDependencies(SystemObject obj, DBObjectProvider pro, boolean recurse)
          Deprecated. use CascadeManager.listReferencedObjects(SystemObject,boolean) on a manager instance.
 DBObjectID[] getReferers(DBObject obj)
          Deprecated. use listReferers(DBObject)
 DBObjectID[] getSchemaObjectReferers(SystemObject obj, boolean deep)
          Deprecated. use CascadeManager.listTopLevelReferers(oracle.javatools.db.SystemObject,boolean)
 boolean hasUnresolvedReference(SystemObject obj, java.lang.String refType)
          Returns true if the given schema object (or any of its children) has an unresolved reference to an object of the given type.
protected  boolean haveRegisteredAll()
          Checks whether the whole provider has been loaded into the manager.
protected  java.util.Collection<DBObjectID> includeSchemaObjects(Schema schema, java.util.Collection<DBObjectID> refs)
           
protected  java.lang.String[] listObjectTypes()
           
 java.util.Collection<DBObjectID> listReferers(DBObject obj)
          Gets the ids of the DBObjects who directly reference the given object.
protected  Schema[] listSchemas()
           
 java.util.Collection<DBObjectID> listTopLevelReferers(SystemObject obj, boolean deep)
          Gets the ids for the SystemObjects who reference (either directly or via their children) the given SystemObject (or one of its children).
protected  boolean needsInitialization(SystemObject obj)
          Returns true if the given schema object isn't built yet (i.e.
protected  void registerAllObjects()
          Registers all objects in the underlying DBObjectProvider with this manager.
 void registerObject(SystemObject obj)
          Register the given SystemObject with this manager.
 void registerObject(SystemObject obj, boolean loadOnly)
          Registers an object on the understanding that this is a load of the object, not a create or update.
protected  boolean resolvesUnresolvedReference(DBObjectID id, DBObjectID unresolved)
          Returns true if the given id resolves the given id that is unresolved.
 java.util.Collection<Difference> resolveUnresolvedReferences(SystemObject obj)
          If this manager supports unresolved references and the given object could potentially fix those references then this method finds any objects that have an unresolved reference and looks to resolve it.
protected  void setRegisterProgress(int objN, int objT, int schemaN, int schemaT, java.lang.String schemaName)
           
protected  boolean shouldRegister(SystemObject obj, boolean loadOnly)
          Online we register objects as they are loaded because all we care about is keeping our cache up-to-date (i.e.
protected  boolean supportsUnresolvedReferences()
          Returns true if this manager supports its objects having unresolved references.
 void unregisterObject(SystemObject obj)
          Unregisters the given object from the object manager.
 
Methods inherited from class oracle.javatools.db.CascadeManager
cascadeDelete, cascadeDelete, doCascadeDelete, getProvider, isUnresolvedReference, listReferencedObjects, updateObjects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaObjectManager

public SchemaObjectManager(DBObjectProvider provider)
Method Detail

haveRegisteredAll

protected final boolean haveRegisteredAll()
Checks whether the whole provider has been loaded into the manager.


clearAllCaches

protected void clearAllCaches()

supportsUnresolvedReferences

protected boolean supportsUnresolvedReferences()
Returns true if this manager supports its objects having unresolved references. Our live database connections don't. Subclasses should override as appropriate.


couldFixUnresolvedReferences

protected boolean couldFixUnresolvedReferences(DBObject obj)
If the provider supports unresolved references this method must return for an object that could resolve them. When registerObject() is called and this method returns true a manager initiliasation will be forced incase this object can resolve unresolved references we have in the provider already.


resolvesUnresolvedReference

protected boolean resolvesUnresolvedReference(DBObjectID id,
                                              DBObjectID unresolved)
Returns true if the given id resolves the given id that is unresolved. Subclasses should override as appropriate.

See Also:
supportsUnresolvedReferences()

registerObject

public void registerObject(SystemObject obj)
Register the given SystemObject with this manager. The object must have valid IDs setup. If this manager isn't initialised yet (i.e. hasn't parsed the whole provider) then nothing will be done as this object will be registered when that is first done.


registerObject

public void registerObject(SystemObject obj,
                           boolean loadOnly)
Registers an object on the understanding that this is a load of the object, not a create or update.

See Also:
registerObject(SystemObject)

shouldRegister

protected boolean shouldRegister(SystemObject obj,
                                 boolean loadOnly)
Online we register objects as they are loaded because all we care about is keeping our cache up-to-date (i.e. the objects we've already looked at). The database will sort itself out.


needsInitialization

protected final boolean needsInitialization(SystemObject obj)
Returns true if the given schema object isn't built yet (i.e. is waiting to be lazy loaded).


unregisterObject

public void unregisterObject(SystemObject obj)
Unregisters the given object from the object manager.


getSchemaObjectReferers

@Deprecated
public DBObjectID[] getSchemaObjectReferers(SystemObject obj,
                                                       boolean deep)
Deprecated. use CascadeManager.listTopLevelReferers(oracle.javatools.db.SystemObject,boolean)

Returns the ids for the SystemObjects who reference (either directly or via their children) the given SystemObject (or one of its children). (e.g. for a Table this would return any Tables, Views or Synonyms (etc) that reference it via FKs, ColumnUsages or Object references).

Parameters:
obj - the object to search for references to
deep - whether to traverse references to the referers etc.

listTopLevelReferers

public java.util.Collection<DBObjectID> listTopLevelReferers(SystemObject obj,
                                                             boolean deep)
Gets the ids for the SystemObjects who reference (either directly or via their children) the given SystemObject (or one of its children).

For example for a Table this would return any Tables, Views or Synonyms (etc) that reference it via FKs, ColumnUsages or Object references).

Specified by:
listTopLevelReferers in class CascadeManager
Parameters:
obj - the object to search for references to
deep - whether to traverse references to the referers etc.
Returns:
the ids of top level objects that reference the given object

includeSchemaObjects

protected java.util.Collection<DBObjectID> includeSchemaObjects(Schema schema,
                                                                java.util.Collection<DBObjectID> refs)

getReferers

@Deprecated
public DBObjectID[] getReferers(DBObject obj)
Deprecated. use listReferers(DBObject)

Returns the DBObjects who directly reference the given DBObject. (e.g for a UK this would return any FKs that reference it).


listReferers

public java.util.Collection<DBObjectID> listReferers(DBObject obj)
Gets the ids of the DBObjects who directly reference the given object. (e.g for a UK this would return any FKs that reference it).

Specified by:
listReferers in class CascadeManager
Parameters:
obj - the object being referenced (e.g. a PK)
Returns:
the ids of any objects directly referencing the given object

hasUnresolvedReference

public boolean hasUnresolvedReference(SystemObject obj,
                                      java.lang.String refType)
Returns true if the given schema object (or any of its children) has an unresolved reference to an object of the given type.


resolveUnresolvedReferences

public java.util.Collection<Difference> resolveUnresolvedReferences(SystemObject obj)
Description copied from class: CascadeManager
If this manager supports unresolved references and the given object could potentially fix those references then this method finds any objects that have an unresolved reference and looks to resolve it. Any objects that are can have their unresolved references resolved are copied, updated and differenced.

Overrides:
resolveUnresolvedReferences in class CascadeManager
Parameters:
obj - the object that is being created and could potentially resolve unresolved references.
Returns:
a collection containing Differences for each object that has unresolved references resolved by the incoming object. The collection might be empty, but will not be null.

checkInit

protected void checkInit()
By default this does nothing. The expectation for a live database is that the SchemaObjectManager maintains a track of the references only for the objects that have been loaded into memory. That way it can be used to invalidate the cache of any object whose dependency is changed.


registerAllObjects

protected final void registerAllObjects()
Registers all objects in the underlying DBObjectProvider with this manager.


listObjectTypes

protected java.lang.String[] listObjectTypes()

listSchemas

protected Schema[] listSchemas()
                        throws DBException
Throws:
DBException

setRegisterProgress

protected void setRegisterProgress(int objN,
                                   int objT,
                                   int schemaN,
                                   int schemaT,
                                   java.lang.String schemaName)

getDependencies

@Deprecated
public static final SystemObject[] getDependencies(SystemObject obj,
                                                              DBObjectProvider pro,
                                                              boolean recurse)
Deprecated. use CascadeManager.listReferencedObjects(SystemObject,boolean) on a manager instance.


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

E13403-05

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