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

E13403-05

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
 
Constructor Summary
DataTypeSynonym()
           
 
Method Summary
protected  void copyToImpl(AbstractDBObject other, DBObject copyParent, IDPolicy idPolicy)
          Implementation method for making a copy of this object.
 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.
protected  boolean equalsImpl(AbstractDBObject other)
          Equals implementation for testing equality with another AbstractDBObject.
 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, copyTo, equals, 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
 

Constructor Detail

DataTypeSynonym

public DataTypeSynonym()
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

copyToImpl

protected void copyToImpl(AbstractDBObject other,
                          DBObject copyParent,
                          IDPolicy idPolicy)
Description copied from class: AbstractDBObject
Implementation method for making a copy of this object. To add custom copyTo logic, a subclass must override this method (exactly), and must call back to the super implementation.

Overrides:
copyToImpl in class AbstractDBObject
Parameters:
other - the copy being created of this object
copyParent - if this object is being copied underneath a parent, this parameter is the copy of the parent of this object, which will therefore need to be the parent of the copy of this object.
idPolicy - the policy for copying the object's ID.

equalsImpl

protected boolean equalsImpl(AbstractDBObject other)
Description copied from class: AbstractDBObject
Equals implementation for testing equality with another AbstractDBObject. Override this method (with exact signature) to customise the equality comparison.

Overrides:
equalsImpl in class AbstractDBObject

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.4.0)

E13403-05

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