public class SchemaObjectManager extends CascadeManager
CascadeManager
CascadeManager.LookupCriteria, CascadeManager.NoCascadeRequiredException
Constructor and Description |
---|
SchemaObjectManager(DBObjectProvider provider) |
Modifier and Type | Method and Description |
---|---|
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. This method always returns an empty array. |
DBObjectID[] |
getReferers(DBObject obj)
Deprecated.
use
listReferers(DBObject) - this method simply
returns an empty array. |
DBObjectID[] |
getSchemaObjectReferers(SystemObject obj,
boolean deep)
Deprecated.
use
CascadeManager.listTopLevelReferers(oracle.javatools.db.SystemObject,boolean)
this method simply returns an empty array. |
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)
Lists all the references to the given object and its children.
|
protected Schema[] |
listSchemas() |
java.util.Collection<DBObjectID> |
listTopLevelReferers(SystemObject obj,
CascadeManager.LookupCriteria criteria)
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.
|
cascadeDelete, cascadeDelete, createIDMap, createIDSet, doCascadeDelete, findPropertyReferences, findReferers, getLogger, getProvider, isUnresolvedReference, listReferencedObjects, listReferencedObjects, listTopLevelReferers
public SchemaObjectManager(DBObjectProvider provider)
protected final boolean haveRegisteredAll()
protected void clearAllCaches()
protected boolean supportsUnresolvedReferences()
protected boolean couldFixUnresolvedReferences(DBObject obj)
protected boolean resolvesUnresolvedReference(DBObjectID id, DBObjectID unresolved)
supportsUnresolvedReferences()
public void registerObject(SystemObject obj)
public void registerObject(SystemObject obj, boolean loadOnly)
registerObject(SystemObject)
protected boolean shouldRegister(SystemObject obj, boolean loadOnly)
protected final boolean needsInitialization(SystemObject obj)
public void unregisterObject(SystemObject obj)
@Deprecated public DBObjectID[] getSchemaObjectReferers(SystemObject obj, boolean deep)
CascadeManager.listTopLevelReferers(oracle.javatools.db.SystemObject,boolean)
this method simply returns an empty array.public java.util.Collection<DBObjectID> listTopLevelReferers(SystemObject obj, CascadeManager.LookupCriteria criteria) throws CancelledException
CascadeManager
For example for a Table this would return any Tables, Views or Synonyms (etc) that reference it via FKs, ColumnUsages or Object references).
The referers will not contain the given object, even if it has internal references (e.g. a PK referencing its own Columns). The references are all external.
listTopLevelReferers
in class CascadeManager
obj
- the object to lookup references tocriteria
- restrictions on the lookupCancelledException
- if the lookup is cancelled while executing.protected final java.util.Collection<DBObjectID> includeSchemaObjects(Schema schema, java.util.Collection<DBObjectID> refs)
@Deprecated public DBObjectID[] getReferers(DBObject obj)
listReferers(DBObject)
- this method simply
returns an empty array.public java.util.Collection<DBObjectID> listReferers(DBObject obj) throws CancelledException
listReferers
in class CascadeManager
obj
- the object being referenced (e.g. a PK)CancelledException
- if the lookup is cancelled while executing.public boolean hasUnresolvedReference(SystemObject obj, java.lang.String refType) throws CancelledException
CancelledException
public java.util.Collection<Difference> resolveUnresolvedReferences(SystemObject obj) throws CancelledException
CascadeManager
resolveUnresolvedReferences
in class CascadeManager
obj
- the object that is being created and could potentially resolve
unresolved references.CancelledException
- if the lookup is cancelled while executing.protected void checkInit() throws CancelledException
CancelledException
protected final void registerAllObjects() throws CancelledException
CancelledException
protected java.lang.String[] listObjectTypes()
protected Schema[] listSchemas() throws DBException
DBException
protected void setRegisterProgress(int objN, int objT, int schemaN, int schemaT, java.lang.String schemaName) throws CancelledException
CancelledException
@Deprecated public static final SystemObject[] getDependencies(SystemObject obj, DBObjectProvider pro, boolean recurse)
CascadeManager.listReferencedObjects(SystemObject,boolean)
on a
manager instance. This method always returns an empty array.