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 DataTypeUsage

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractChildDBObject
          extended by oracle.javatools.db.datatypes.DataTypeUsage
All Implemented Interfaces:
ChildDBObject, DBObject, Copyable, DynamicPropertySet
Direct Known Subclasses:
ObjectTypeUsage, PredefinedDataTypeUsage

public abstract class DataTypeUsage
extends AbstractChildDBObject

To "use" a DataType is to refere to it by ID and store values for any attributes that DataType may have (e.g. precision, scale, size). All attribute values are stored in a map against that attribute's name. The ID of the DataType being used is also stored.

A DataTypeUsage can be "validated" by its corresponding DataType.

This replaces the deprecated way of storing scale and precision on a Column which was not flexible enough to support all datatype attributes.

To get a String representation of the usage and attributes use the DataType.getDDL(oracle.javatools.db.datatypes.DataTypeUsage) method.

Code examples for using DataTypeUsages are available in the datatypes datatypes package summary

Since:
10.1.3

Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
static java.lang.String TYPE
           
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
protected DataTypeUsage()
           
protected DataTypeUsage(DataType dt)
           
 
Method Summary
protected  void copyToImpl(AbstractDBObject target, DBObject copyParent, IDPolicy idPolicy)
          Implementation method for making a copy of this object.
 void deleteAttributeValue(java.lang.String name)
          Deletes entry named name.
protected  boolean equalsImpl(AbstractDBObject target)
          Equals implementation for testing equality with another AbstractDBObject.
 java.lang.Object getAttributeValue(java.lang.String name)
          Gets the value of the given named attribute.
 java.util.Map<java.lang.String,java.lang.Object> getAttributeValues()
          Returns the keys/values of all attributes in this usage.
 DBObjectID getDataTypeID()
          Gets the id of the DataType being used.
 java.lang.String getType()
          Returns the type of this object.
 boolean hasAttributeValue(java.lang.String name)
          Returns true if there is an entry for the given attribute name.
 void putAttributeValue(java.lang.String name, java.lang.Object value)
          Adds {attribute_name, attribute_value} to self or replaces value where an entry for name already exists.
 void setAttributeValues(java.util.Map<java.lang.String,java.lang.Object> attributeValues)
          Sets the keys/values of all attributes in this usage.
 void setDataTypeID(DBObjectID dataTypeID)
          Sets the id of the DataType being used.
 
Methods inherited from class oracle.javatools.db.AbstractChildDBObject
findParent, getParent, getProperty, setParent, setProperty
 
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, getReferenceIDs, getReferenceIDsImpl, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties, 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, setProperties
 

Field Detail

TYPE

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

DataTypeUsage

protected DataTypeUsage()

DataTypeUsage

protected DataTypeUsage(DataType dt)
Method Detail

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.

equalsImpl

protected boolean equalsImpl(AbstractDBObject target)
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

copyToImpl

protected void copyToImpl(AbstractDBObject target,
                          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 AbstractChildDBObject
Parameters:
target - 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.

setDataTypeID

public final void setDataTypeID(DBObjectID dataTypeID)
Sets the id of the DataType being used.


getDataTypeID

public final DBObjectID getDataTypeID()
Gets the id of the DataType being used.

Returns:
the DataTypeID of this usage.

setAttributeValues

public final void setAttributeValues(java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Sets the keys/values of all attributes in this usage.

Parameters:
attributeValues - (attribute_name, attribute_value) map of usage values

getAttributeValues

public final java.util.Map<java.lang.String,java.lang.Object> getAttributeValues()
Returns the keys/values of all attributes in this usage.

Returns:
{attribute_name, attribute_value} map of usage values

getAttributeValue

public final java.lang.Object getAttributeValue(java.lang.String name)
Gets the value of the given named attribute.

Parameters:
name -
Returns:
attribute value for attribute name, or null if no value exists.

putAttributeValue

public final void putAttributeValue(java.lang.String name,
                                    java.lang.Object value)
Adds {attribute_name, attribute_value} to self or replaces value where an entry for name already exists.

Parameters:
name -
value -

deleteAttributeValue

public final void deleteAttributeValue(java.lang.String name)
Deletes entry named name.

Parameters:
name -

hasAttributeValue

public final boolean hasAttributeValue(java.lang.String name)
Returns true if there is an entry for the given attribute name.

Parameters:
name -
Returns:

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.