Extension SDK 10.1.3.36.73

oracle.javatools.db
Class AbstractDBObject

java.lang.Object
  extended byoracle.javatools.db.AbstractDBObject
All Implemented Interfaces:
Copyable, DBObject, DynamicPropertySet
Direct Known Subclasses:
AbstractSchemaObject, AbstractSQLFragment, Column, Constraint, DataTypeAttribute, Index, PlSqlAttribute, PlSqlMethod, PlSqlParameter, PredefinedDataType, Schema

public abstract class AbstractDBObject
extends java.lang.Object
implements DBObject

Provides an abstract implementation of the DBObject interface.

Since:
9.0.5

Field Summary
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
protected AbstractDBObject()
          Constructs a new instance.
protected AbstractDBObject(java.lang.String name)
          Constructs a new instance with the specified name.
protected AbstractDBObject(java.lang.String name, DBObjectID id)
           
 
Method Summary
protected  int compareToImpl(AbstractDBObject target)
           
protected  void copyToImpl(AbstractDBObject copy)
           
protected  boolean equalsImpl(AbstractDBObject other)
           
 DBObject findOwnedObject(java.lang.String type, java.lang.String name)
          Final implementation uses getChildrenImpl( String type ) and searches through the contained DBObjects by name.
 DBObjectID getID()
          Retrieves the object ID associated with this object.
 java.lang.String getName()
          Retrieves the name of this object.
 DBObject[] getOwnedObjects()
          Final implementation calls getChildrenImpl( String type ) with a null argument for the type.
 DBObject[] getOwnedObjects(java.lang.String type)
          Final implementation calls getChildrenImpl( String type ) with the given type.
protected  void getOwnedObjectsImpl(java.util.Collection objs, java.lang.String type)
          Used by all the final children methods.
 java.util.Map getProperties()
          Returns null if no properties are set.
 java.lang.Object getProperty(java.lang.String key)
          Retrieves the value associated with a property.
 java.lang.Object getProperty(java.lang.String key, java.lang.Object defaultValue)
          Retrieves the value associated with a property.
 DBObjectID[] getReferenceIDs()
          Final implementation that calls the internal getReferenceIDsImpl() method.
protected  void getReferenceIDsImpl(java.util.Collection refs)
          Used by the final getReferenceID() implementation.
 int hashCode()
           
 boolean replaceReferenceIDs(java.util.Map idMap)
          Default implementation does nothing and returns false.
 void setID(DBObjectID id)
          Sets the object ID associated with this object.
 void setName(java.lang.String name)
          Sets the name of this object.
 void setProperties(java.util.Map properties)
          Sets the map holding the property-value pairs.
 void setProperty(java.lang.String key, java.lang.Object value)
          Sets the value for a property.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.javatools.db.DBObject
copyTo, getParent, getType
 

Constructor Detail

AbstractDBObject

protected AbstractDBObject()
Constructs a new instance.


AbstractDBObject

protected AbstractDBObject(java.lang.String name)
Constructs a new instance with the specified name.

Parameters:
name - a string representing the name of this object.

AbstractDBObject

protected AbstractDBObject(java.lang.String name,
                           DBObjectID id)
Method Detail

copyToImpl

protected void copyToImpl(AbstractDBObject copy)

equalsImpl

protected boolean equalsImpl(AbstractDBObject other)

compareToImpl

protected int compareToImpl(AbstractDBObject target)

toString

public java.lang.String toString()

hashCode

public int hashCode()

setName

public void setName(java.lang.String name)
Description copied from interface: DBObject
Sets the name of this object.

Specified by:
setName in interface DBObject
Parameters:
name - a string containing the new name for this object.

getName

public java.lang.String getName()
Description copied from interface: DBObject
Retrieves the name of this object.

Specified by:
getName in interface DBObject
Returns:
a string containing the name of this object.

setID

public void setID(DBObjectID id)
Description copied from interface: DBObject
Sets the object ID associated with this object. Note that the ID should only be set at most once. Implementations should ensure that the id is not reset.

Specified by:
setID in interface DBObject
Parameters:
id - the DBObjectID to be associated with this object

getID

public DBObjectID getID()
Description copied from interface: DBObject
Retrieves the object ID associated with this object.

Specified by:
getID in interface DBObject
Returns:
the DBObjectID associated with this object

getProperties

public java.util.Map getProperties()
Returns null if no properties are set.

Specified by:
getProperties in interface DynamicPropertySet

getProperty

public java.lang.Object getProperty(java.lang.String key)
Description copied from interface: DynamicPropertySet
Retrieves the value associated with a property.

Specified by:
getProperty in interface DynamicPropertySet
Parameters:
key - the property key for which a value is desired. exists.
Returns:
the value of the requested property, or a null value if the property does not exist or is not set.

getProperty

public java.lang.Object getProperty(java.lang.String key,
                                    java.lang.Object defaultValue)
Description copied from interface: DynamicPropertySet
Retrieves the value associated with a property. If no value exists for the requested property, the specified default value is returned.

Specified by:
getProperty in interface DynamicPropertySet
Parameters:
key - the property key for which a value is desired.
defaultValue - the value to return if no value currently exists.
Returns:
the value of the requested property, or the default value if the property does not exist.

setProperties

public void setProperties(java.util.Map properties)
Description copied from interface: DynamicPropertySet
Sets the map holding the property-value pairs.

Specified by:
setProperties in interface DynamicPropertySet

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Description copied from interface: DynamicPropertySet
Sets the value for a property. Setting a value to null removes that property.

Specified by:
setProperty in interface DynamicPropertySet
Parameters:
key - the property key to set
value - the value to set

getOwnedObjects

public final DBObject[] getOwnedObjects()
Final implementation calls getChildrenImpl( String type ) with a null argument for the type. Subclasses must override getChildrenImpl as appropriate.

Specified by:
getOwnedObjects in interface DBObject
Returns:
the children of the object, null if none.

getOwnedObjects

public final DBObject[] getOwnedObjects(java.lang.String type)
Final implementation calls getChildrenImpl( String type ) with the given type. Subclasses must override getChildrenImpl as appropriate.

Specified by:
getOwnedObjects in interface DBObject
Parameters:
type - the DBObject type for the children to be returned (e.g. Column.TYPE)

findOwnedObject

public final DBObject findOwnedObject(java.lang.String type,
                                      java.lang.String name)
Final implementation uses getChildrenImpl( String type ) and searches through the contained DBObjects by name. Subclasses must override getChildrenImpl as appropriate.

Specified by:
findOwnedObject in interface DBObject
Parameters:
type - the DBObject type for the child to be returned (e.g. Column.TYPE)
name - the name of the DBObject to be returned
Returns:
the appropriate child object, if one exists.

getOwnedObjectsImpl

protected void getOwnedObjectsImpl(java.util.Collection objs,
                                   java.lang.String type)
Used by all the final children methods. Subclasses should start with super.getOwnedObjectsImpl(type) and then add to the returned list.

Parameters:
type - the type to search for
Returns:
a Collection of the apppropriate children.

getReferenceIDs

public final DBObjectID[] getReferenceIDs()
Final implementation that calls the internal getReferenceIDsImpl() method. Subclasses should override that method.

Specified by:
getReferenceIDs in interface DBObject
Returns:
all property values that are DBObjectIDs.

getReferenceIDsImpl

protected void getReferenceIDsImpl(java.util.Collection refs)
Used by the final getReferenceID() implementation. The list should not containnull values, or be null. Subclasses should start with super.getReferenceIDsImpl() and add to the returned list as appopriate.


replaceReferenceIDs

public boolean replaceReferenceIDs(java.util.Map idMap)
Default implementation does nothing and returns false. Override in subclasses to replace and reference IDs as appropriate.

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

Extension SDK 10.1.3.36.73

 

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