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
Interface DataType

All Superinterfaces:
Copyable, DBObject, DynamicPropertySet
All Known Implementing Classes:
BaseDateTimeDataType, BinaryDataType, CharacterDataType, ComplexType, DataTypeSynonym, DateDataType, NumericDataType, ObjectType, OracleNumberDataType, PredefinedDataType, TimeStampTZDataType, UserDataType

public interface DataType
extends DBObject

Interface defines a database datatype (e.g. VARCHAR, INTEGER) abstractly in terms of its attributes (e.g. size, precision, scale). It has methods to return the DDL representing its definition, and to validate a usage or default value for the represented type.

This replaces the deprecated oracle.javatools.db.DataType.

Since:
10.1.3

Field Summary
static java.lang.String PCTROWTYPE
           
static java.lang.String PCTTYPE
           
static java.lang.String REF
           
static java.lang.String TYPE
           
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Method Summary
 DataTypeUsage createDefaultUsage()
          Returns an DataTypeUsage object for this type.
 DataTypeUsage createUsage(java.util.Map<java.lang.String,java.lang.Object> 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.
 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.
 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 interface oracle.javatools.db.DBObject
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getParent, getReferenceIDs, getType, replaceReferenceIDs, setID, setName
 
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, getProperty, setProperties, setProperty
 

Field Detail

TYPE

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

PCTTYPE

static final java.lang.String PCTTYPE
See Also:
Constant Field Values

PCTROWTYPE

static final java.lang.String PCTROWTYPE
See Also:
Constant Field Values

REF

static final java.lang.String REF
See Also:
Constant Field Values
Method Detail

getDataTypeAttributes

DataTypeAttribute[] getDataTypeAttributes()
Returns the DataTypeAttributes for this DataType.

Returns:
DataType's DataTypeAttributes in the order they were added.

hasDataTypeAttribute

boolean hasDataTypeAttribute(java.lang.String name)
Returns true if this DataTYpe has the given attribute name.

Parameters:
name -
Returns:
true if the DataTypeAttribute corresponding to name exists.

getDataTypeAttribute

DataTypeAttribute getDataTypeAttribute(java.lang.String name)
Returns the DataTypeAttribute with the given name, if this DataType has such an attribute.

Parameters:
name -
Returns:
The DataTypeAttribute corresponding to name or null if none exists.

getDDL

java.lang.String getDDL(DataTypeUsage dataTypeUsage)
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.

Parameters:
dataType -

createDefaultUsage

DataTypeUsage createDefaultUsage()
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.


createUsage

DataTypeUsage createUsage(java.util.Map<java.lang.String,java.lang.Object> attributes)
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.

Parameters:
attributes -

matches

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

Parameters:
usageString -

createUsage

DataTypeUsage createUsage(java.lang.String usageString)
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 matches(java.lang.String). Should be overridden by sub-classes to return an object of the sub-class type.

Parameters:
attributes -

validateUsage

void validateUsage(DataTypeUsage dataTypeUsage,
                   DBObject dbObject)
                   throws DataTypeValidationException
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.

Parameters:
dataTypeUsage - : the usage to be validated
dbObject - : the context of the data type usage
Throws:
DataTypeValidationException

validateDefaultValue

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

Parameters:
dataTypeUsage - : the usage to be validated
defaultValue - : the default value
dbObject - : the context of the data type usage
Throws:
DefaultValueValidationException

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.