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

E13403-03

oracle.javatools.db.datatypes
Class DataTypeSynonym

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.datatypes.DataTypeSynonym
All Implemented Interfaces:
DataType, DBObject, Copyable, DynamicPropertySet

public class DataTypeSynonym
extends AbstractDBObject
implements DataType

DataType implementation that delegates all calls to an underlying DataType that it is a "synonym" for. The name is the only difference between a DataTypeSynonym and its underlying DataType.
A DataType could be a synonym for another DataType without being an instance of this class. This class is used for the subset of synonyms where the behaviour of both types is identical.

Since:
10.1.3

Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
 
Fields inherited from interface oracle.javatools.db.datatypes.DataType
PCTROWTYPE, PCTTYPE, REF, TYPE
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Method Summary
 DBObject copyTo(DBObject target, DBObject copyParent, IDPolicy idPolicy)
          Internal copy method used by the API to perform copy operations.
protected  void copyToImpl(DataTypeSynonym target, DBObject copyParent, IDPolicy idPolicy)
           
 DataTypeUsage createDefaultUsage()
          Returns an DataTypeUsage object for this type.
 DataTypeUsage createUsage(java.util.Map attributes)
          Returns an DataTypeUsage object for this type, populated with attributes.
 DataTypeUsage createUsage(java.lang.String usageString)
          Returns an DataTypeUsage object for this type, populated with attributes based on the usageString.
 boolean equals(java.lang.Object obj)
           
protected  boolean equalsImpl(DataTypeSynonym other)
           
 DataType getBaseType()
           
 DataTypeAttribute getDataTypeAttribute(java.lang.String name)
          Returns the DataTypeAttribute with the given name, if this DataType has such an attribute.
 DataTypeAttribute[] getDataTypeAttributes()
          Returns the DataTypeAttributes for this DataType.
 java.lang.String getDDL(DataTypeUsage dataTypeUsage)
          Generates the DDL for this type.
 DBObject getParent()
          Returns the parent of this object, if one exists.
 java.lang.String getType()
          Returns the type of this object.
 boolean hasDataTypeAttribute(java.lang.String name)
          Returns true if this DataTYpe has the given attribute name.
 boolean matches(java.lang.String usageString)
          Returns true if the usageString is valid syntax for the DataType, false otherwise.
 void validateDefaultValue(java.lang.Object defaultValue, DataTypeUsage dataTypeUsage, DBObject dbObject)
          Validates defaultValue for dataTypeUsage against self's definition.
 void validateUsage(DataTypeUsage dataTypeUsage, DBObject dbObject)
          Validates dataTypeUsage against self's definition.
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyToImpl, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getProperty, getReferenceIDs, getReferenceIDsImpl, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, 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
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, replaceReferenceIDs, setID, setName
 
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, getProperty, setProperties, setProperty
 

Method Detail

getBaseType

public DataType getBaseType()

getDataTypeAttributes

public DataTypeAttribute[] getDataTypeAttributes()
Description copied from interface: DataType
Returns the DataTypeAttributes for this DataType.

Specified by:
getDataTypeAttributes in interface DataType
Returns:
DataType's DataTypeAttributes in the order they were added.

hasDataTypeAttribute

public boolean hasDataTypeAttribute(java.lang.String name)
Description copied from interface: DataType
Returns true if this DataTYpe has the given attribute name.

Specified by:
hasDataTypeAttribute in interface DataType
Returns:
true if the DataTypeAttribute corresponding to name exists.

getDataTypeAttribute

public DataTypeAttribute getDataTypeAttribute(java.lang.String name)
Description copied from interface: DataType
Returns the DataTypeAttribute with the given name, if this DataType has such an attribute.

Specified by:
getDataTypeAttribute in interface DataType
Returns:
The DataTypeAttribute corresponding to name or null if none exists.

getDDL

public java.lang.String getDDL(DataTypeUsage dataTypeUsage)
Description copied from interface: DataType
Generates the DDL for this type. Uses dataTypeUsages's get() methods to get the actual property values. Should be overridden by sub-classes to generate extra bits.

Specified by:
getDDL in interface DataType

createDefaultUsage

public DataTypeUsage createDefaultUsage()
Description copied from interface: DataType
Returns an DataTypeUsage object for this type. Used by UI to create a default data type usage. Mandatory declarable attributes of the data type are initialised with appropriate values, e.g. the size of a usage of an Oracle VARCHAR2 data type would be set to 4000, its maximum. Should be overridden by sub-classes to return an object of the sub-class type.

Specified by:
createDefaultUsage in interface DataType

createUsage

public DataTypeUsage createUsage(java.util.Map attributes)
Description copied from interface: DataType
Returns an DataTypeUsage object for this type, populated with attributes. Should be overridden by sub-classes to return an object of the sub-class type.

Specified by:
createUsage in interface DataType

validateUsage

public void validateUsage(DataTypeUsage dataTypeUsage,
                          DBObject dbObject)
                   throws DataTypeValidationException
Description copied from interface: DataType
Validates dataTypeUsage against self's definition. Uses dataTypeUSage's get() methods to get the actual property values for validation. Should be overridden by sub-classes to do sub-class validation.

Specified by:
validateUsage in interface DataType
Parameters:
dataTypeUsage - : the usage to be validated
dbObject - : the context of the data type usage
Throws:
DataTypeValidationException

validateDefaultValue

public void validateDefaultValue(java.lang.Object defaultValue,
                                 DataTypeUsage dataTypeUsage,
                                 DBObject dbObject)
                          throws DefaultValueValidationException
Description copied from interface: DataType
Validates defaultValue for dataTypeUsage against self's definition. Method should be overridden by sub-classes to do sub-class validation.

Specified by:
validateDefaultValue in interface DataType
Parameters:
defaultValue - : the default value
dataTypeUsage - : the usage to be validated
dbObject - : the context of the data type usage
Throws:
DefaultValueValidationException

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(DataTypeSynonym target,
                          DBObject copyParent,
                          IDPolicy idPolicy)

equals

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

equalsImpl

protected boolean equalsImpl(DataTypeSynonym other)

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.

Specified by:
getType in interface DBObject
Returns:
a string describing the type of object.

getParent

public DBObject getParent()
Description copied from interface: DBObject
Returns the parent of this object, if one exists. This does not return the Schema for a SchemaObject. Schema's are not considered part of the ownership parent tree.

Specified by:
getParent in interface DBObject

matches

public boolean matches(java.lang.String usageString)
Description copied from interface: DataType
Returns true if the usageString is valid syntax for the DataType, false otherwise. Should be overridden by sub-classes to do the validation.

Specified by:
matches in interface DataType

createUsage

public DataTypeUsage createUsage(java.lang.String usageString)
Description copied from interface: DataType
Returns an DataTypeUsage object for this type, populated with attributes based on the usageString. Returns null if the usageString does not match the syntax of the DataType. See DataType.matches(java.lang.String). Should be overridden by sub-classes to return an object of the sub-class type.

Specified by:
createUsage in interface DataType

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

E13403-03

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