Extension SDK 10.1.3.36.73

oracle.javatools.db
Class Synonym

java.lang.Object
  extended byoracle.javatools.db.AbstractDBObject
      extended byoracle.javatools.db.AbstractSchemaObject
          extended byoracle.javatools.db.Synonym
All Implemented Interfaces:
Copyable, DBObject, DynamicPropertySet, SchemaObject

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.


Field Summary
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
 java.lang.Object copyTo(java.lang.Object target)
          Copies the state of this DBObject to another instance.
protected  void copyToImpl(Synonym copy)
           
 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 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 idMap)
          Replaces any reference ids (e.g.
 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, checkInit, copyToImpl, equalsImpl, fireObjectUpdated, getOwnedObjectsImpl, getParent, getSchema, needsInitialization, removeObjectListener, setSchema
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
compareToImpl, copyToImpl, equalsImpl, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getProperties, getProperty, getProperty, getReferenceIDs, hashCode, setID, setName, setProperties, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.javatools.db.DBObject
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
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 java.lang.Object copyTo(java.lang.Object target)
Description copied from interface: DBObject
Copies the state of this DBObject to another instance. If null is specified for the target, a new instance will be created.

The entire state of the object will be copied, with a few exceptions. In particular, any observers registered will NOT be copied. In cases where this instance contains child DBObjects, new instances of those children will be created, and the state copied to them. The copy will thus contain its own unique state; after making the copy, changing one instance will not cause any changes to occur to the copy. The properties will be copied; however, copies will not be made of the values referenced by the properties - thus, the copy will refer to the same instance as the original. Child objects that are copied will still point to the original parent; it is the responsibility of a copied parent to update the parent of copies of its children point to the copy of itself.

The ID associated with this object will not be copied. If the copy is intended to be a temporary copy of this object (to be used in a dialog editing the object for example), then the caller should explicitly set the ID of the copy to be the same as on this object. However, if the new object is intended to exist separately from this object, the caller should ensure that the new object have a different ID from this object.

Parameters:
target - The object to copy to. If target is null, a new instance will be created, and the state will be copied to that object.
Returns:
the copy.

copyToImpl

protected void copyToImpl(Synonym copy)

equals

public boolean equals(java.lang.Object target)

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 refs)
Description copied from class: AbstractSchemaObject
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 AbstractSchemaObject

replaceReferenceIDs

public boolean replaceReferenceIDs(java.util.Map idMap)
Description copied from interface: DBObject
Replaces any reference ids (e.g. "reference id" on an FKConstraint) on the object with new versions of that id according to the entries in the Map. This can be used to hook up old and new ids between copies of the same object, or to update a referencing id after an object's id has changed.

Specified by:
replaceReferenceIDs in interface DBObject
Overrides:
replaceReferenceIDs in class AbstractDBObject

Extension SDK 10.1.3.36.73

 

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