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

E13403-04

oracle.javatools.db
Class Synonym

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractBuildableObject
          extended by oracle.javatools.db.AbstractSchemaObject
              extended by oracle.javatools.db.Synonym
All Implemented Interfaces:
DBObject, SchemaObject, SystemObject, Copyable, DynamicPropertySet

public class Synonym
extends AbstractSchemaObject

Model of a database synonym. A synonym is a reference to another object. Synonyms can be defined as being public, in which case they are available to all users without a schema qualifier.


Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
static java.lang.String PUBLIC_TYPE
           
static java.lang.String TYPE
           
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
Synonym()
          Constructs a new Synonym.
Synonym(java.lang.String name, Schema schema, DBObjectID ref)
          Constructs a new Synonym pointing to a specific object, in a specific schema, and with a specific name.
 
Method Summary
 DBObject copyTo(DBObject target, DBObject copyParent, IDPolicy idPolicy)
          Internal copy method used by the API to perform copy operations.
protected  void copyToImpl(Synonym copy, DBObject copyParent, IDPolicy idPolicy)
           
 boolean equals(java.lang.Object target)
           
protected  boolean equalsImpl(Synonym target)
           
 DBObjectID getReference()
          Retrieves the object refered to by this synonym.
protected  void getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
          Implementation first checks that the object has been built - then returns the collection from suprt.getReferenceIDsImpl().
 java.lang.String getType()
          Returns the type of this object.
 boolean isPublic()
          Whether this synonynm is public.
 boolean replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
          Override in subclasses to replace reference IDs as appropriate.
 void setPublic(boolean pub)
          Sets whether this synonym is public.
 void setReference(DBObjectID ref)
          Sets the object refered to by this synonym.
 
Methods inherited from class oracle.javatools.db.AbstractSchemaObject
addObjectListener, copyToImpl, equalsImpl, getParent, getSchema, removeObjectListener, setSchema
 
Methods inherited from class oracle.javatools.db.AbstractBuildableObject
addObjectListener, checkInit, checkInit, checkInitEx, copyToImpl, equalsImpl, fireObjectUpdated, getOwnedObjectsImpl, getProperties, getProperty, getProperty, needsInitialization, removeObjectListener, setProperties, setProperty
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyToImpl, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, setID, setName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.javatools.db.SystemObject
addObjectListener, fireObjectUpdated, removeObjectListener
 
Methods inherited from interface oracle.javatools.db.DBObject
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, setID, setName
 
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, getProperty, setProperties, setProperty
 

Field Detail

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

PUBLIC_TYPE

public static final java.lang.String PUBLIC_TYPE
See Also:
Constant Field Values
Constructor Detail

Synonym

public Synonym()
Constructs a new Synonym.


Synonym

public Synonym(java.lang.String name,
               Schema schema,
               DBObjectID ref)
Constructs a new Synonym pointing to a specific object, in a specific schema, and with a specific name.

Parameters:
name - a string containing the name of the synonym
schema - the schema containing the synonym
ref - the Object this synonym refers to
Method Detail

copyTo

public DBObject copyTo(DBObject target,
                       DBObject copyParent,
                       IDPolicy idPolicy)
Description copied from class: AbstractDBObject
Internal copy method used by the API to perform copy operations. All objects must implement this method if they are instantiable objects. Abstract objects (e.g. Relation) must NOT implement this method. The implementation should delegate to the copyToImpl method to copy the actual properties.

This method does not fix internal reference ids on copy. That is done by the calling DBObject.copyTo(DBObject, IDPolicy) method.

Specified by:
copyTo in class AbstractDBObject
See Also:
DBObject.copyTo(java.lang.Object), DBObject.copyTo(DBObject, boolean), AbstractDBObject.copyToImpl(oracle.javatools.db.AbstractDBObject, oracle.javatools.db.DBObject, oracle.javatools.db.IDPolicy)

copyToImpl

protected void copyToImpl(Synonym copy,
                          DBObject copyParent,
                          IDPolicy idPolicy)

equals

public boolean equals(java.lang.Object target)
Overrides:
equals in class java.lang.Object

equalsImpl

protected boolean equalsImpl(Synonym target)

getReference

public DBObjectID getReference()
Retrieves the object refered to by this synonym.

Returns:
the object referenced by this synonym

setReference

public void setReference(DBObjectID ref)
Sets the object refered to by this synonym.

Parameters:
ref - the object referenced by this synonym

isPublic

public boolean isPublic()
Whether this synonynm is public. A public synonym is available without a schema qualifier.

Returns:
a boolean value indicating whether this schema is public

setPublic

public void setPublic(boolean pub)
Sets whether this synonym is public. A public synonym is available without a schema qualifier.

Parameters:
pub - a boolean value indicating whether this schema is public

getType

public java.lang.String getType()
Description copied from interface: DBObject
Returns the type of this object. Valid types include things like tables, views, synonyms, and columns.

Returns:
a string describing the type of object.

getReferenceIDsImpl

protected void getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
Description copied from class: AbstractBuildableObject
Implementation first checks that the object has been built - then returns the collection from suprt.getReferenceIDsImpl(). All overrides must call this first to ensure the object has been built.

Overrides:
getReferenceIDsImpl in class AbstractBuildableObject
Parameters:
refs - the collection of ids this object references

replaceReferenceIDs

public boolean replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
Description copied from class: AbstractDBObject
Override in subclasses to replace reference IDs as appropriate. Always call super in the overridden implementation to make sure the default implementation (which checks the property map) is called.

Specified by:
replaceReferenceIDs in interface DBObject
Overrides:
replaceReferenceIDs in class AbstractDBObject
Parameters:
idMap - key = old DBObjectID, value = new DBObjectID
Returns:
true if any ids were replaced.

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

E13403-04

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