See: Description
| Interface | Description |
|---|---|
| DataType |
Interface defines a database datatype (VARCHAR, INTEGER etc) abstractly
in terms of its attributes (size, precision, scale etc).
|
| Class | Description |
|---|---|
| DataTypeAttribute |
A data type can have a number of attributes that define its behaviour -
size, precision, scale etc.
|
| DataTypeCache |
Cache for DataTypes that allows their registration via only their name.
|
| DataTypeHelper |
Helper class for dealing with DataTypes and the DataTypeUsage object.
|
| DataTypeID |
INTERNAL USE ONLY.
|
| DataTypeRegistry |
Registry for DataTypes.
|
| DataTypeRegistry.Registerer |
A Registerer is responsible for providing allowed DataTypes for a given
provider class.
|
| DataTypeSynonym |
DataType implementation that delegates all calls to an underlying DataType
that it is a "synonym" for.
|
| DataTypeUsage |
To "use" a DataType is to refer to it by ID and store values for any
attributes that DataType may have (precision, scale, size etc).
|
| PredefinedDataType |
Default DataType implementation for simple (built-in) data types in a
database.
|
| PredefinedDataTypeUsage | Deprecated |
| UserDataType |
Defines a data type that we 'discovered' when importing or navigating a
database, usually from a foreign database, or for un-imported object types.
|
| Enum | Description |
|---|---|
| PredefinedDataType.ValueType |
The type of value that a use of this data type should have.
|
| Exception | Description |
|---|---|
| DataTypeValidationException | Deprecated
with no replacement - use
ValidationException |
| DefaultValueValidationException | Deprecated
with no replacement - use
ValidationException. |
DataType definitions are DBObjects, and are retrieved from a
DBObjectProvider using the listDataTypes and getDataType
methods. For ComplexType objects the listObjects and
getObject methods should be used with their type string
ComplexType.TYPE.
DataTypeUsage
object. This includes the ID of the datatype, as well as any attributes
associated with its use (e.g. size,
scale, precision etc). For more information see DataTypeUsage.
In general when using DataType and DataTypeUsage objects, the
DataTypeHelper class provides a lot of useful helper methods.
Column's DataTypeUsage
final Column ename = table.getColumn( "ENAME" );
final DataTypeUsage datatypeUsage = ename.getDataTypeUsage();
final Long size = DataTypeHelper.getLongAttributeValue(
datatypeUsage,
DataTypeAttribute.DATATYPE_SIZE );
final DataType datatype = provider.getDataType( "VARCHAR2" );
final DataTypeUsage datatypeUsage = datatype.createDefaultUsage();
datatypeUsage.putAttributeValue( DataTypeAttribute.DATATYPE_SIZE,
30L );
oracle.javatools.db