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

E13403-03

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(DataTypeUsage target, DBObject copyParent, IDPolicy idPolicy)
           
 void deleteAttributeValue(java.lang.String name)
          Deletes entry named name.
protected  boolean equalsImpl(DataTypeUsage target)
           
 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.
protected  void getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
          Used by the final getReferenceID() implementation.
 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.
 boolean replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
          Override in subclasses to replace reference IDs as appropriate.
 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 id)
          Sets the id of the DataType being used.
 
Methods inherited from class oracle.javatools.db.AbstractChildDBObject
copyToImpl, findParent, getParent, setParent
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, copyToImpl, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getProperty, getReferenceIDs, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, setID, setName, setProperties, setProperty, 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, copyTo, copyTo, findOwnedObject, 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

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.

replaceReferenceIDs

public boolean replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
Description copied from class: AbstractDBObject
Override in subclasses to replace reference IDs as appropriate. Always call super in the overridden implementation to make sure the default implementation (which checks the property map) is called.

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

getReferenceIDsImpl

protected void getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
Description copied from class: AbstractDBObject
Used by the final getReferenceID() implementation. The list should not contain null values, or be null. Subclasses should start with super.getReferenceIDsImpl() and then add to the passed list as appopriate.

Overrides:
getReferenceIDsImpl in class AbstractDBObject
Parameters:
refs - the collection of ids this object references

equalsImpl

protected boolean equalsImpl(DataTypeUsage target)

copyToImpl

protected void copyToImpl(DataTypeUsage target,
                          DBObject copyParent,
                          IDPolicy idPolicy)

setDataTypeID

public final void setDataTypeID(DBObjectID id)
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)

E13403-03

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