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

E13403-04

oracle.javatools.db.datatypes
Class NumericDataType

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.datatypes.PredefinedDataType
          extended by oracle.javatools.db.datatypes.NumericDataType
All Implemented Interfaces:
DataType, DBObject, Copyable, DynamicPropertySet
Direct Known Subclasses:
OracleNumberDataType

public class NumericDataType
extends PredefinedDataType

Since:
10.1.3

Nested Class Summary
static class NumericDataType.MinMaxValue
          public static class MinMaxValue defines the minimum and maximum value range of integer and floating-point numbers for use by NumericDataType.validateDefaultValue().
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
static NumericDataType.MinMaxValue MIN_MAX_BIGINT
          Standard definitions of integer MinMaxValues.
static NumericDataType.MinMaxValue MIN_MAX_BIT
           
static NumericDataType.MinMaxValue MIN_MAX_INT
           
static NumericDataType.MinMaxValue MIN_MAX_MEDIUMINT
           
static NumericDataType.MinMaxValue MIN_MAX_MONEY
           
static NumericDataType.MinMaxValue MIN_MAX_SIGNED_TINYINT
           
static NumericDataType.MinMaxValue MIN_MAX_SMALLINT
           
static NumericDataType.MinMaxValue MIN_MAX_SMALLMONEY
           
static NumericDataType.MinMaxValue MIN_MAX_UNSIGNED_TINYINT
           
static DataTypeAttribute UNSIGNED
          Standard definition of UNSIGNED data type attribute
 
Fields inherited from interface oracle.javatools.db.datatypes.DataType
PCTROWTYPE, PCTTYPE, REF, TYPE
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
NumericDataType()
           
NumericDataType(int domain, java.lang.String name, NumericDataType.MinMaxValue minMaxValues)
          Use this constructor when the data type is a simple name with no declarable attributes, e.g.
NumericDataType(int domain, java.lang.String name, java.lang.String definition, DataTypeAttribute[] attributes, NumericDataType.MinMaxValue minMaxValues)
          Use this constructor when the data type has declarable attributes, e.g.
NumericDataType(int domain, java.lang.String name, java.lang.String definition, long minPrecision, long maxPrecision, java.lang.Long defaultPrecision, boolean isPrecisionMandatory, DataTypeAttribute[] attributes, NumericDataType.MinMaxValue minMaxValues)
          Use this constructor when the datatype has declarable precision, e.g.
NumericDataType(int domain, java.lang.String name, java.lang.String definition, long minPrecision, long maxPrecision, java.lang.Long defaultPrecision, boolean isPrecisionMandatory, long minScale, java.lang.Long maxScale, java.lang.Long defaultScale, boolean isScaleMandatory, DataTypeAttribute[] attributes, NumericDataType.MinMaxValue minMaxValues)
          Use this constructor when the number type has declarable precision and scale, e.g.
 
Method Summary
 DBObject copyTo(DBObject target, DBObject copyParent, IDPolicy idPolicy)
          Internal copy method used by the API to perform copy operations.
protected  void copyToImpl(NumericDataType target, DBObject copyParent, IDPolicy idPolicy)
           
 boolean equals(java.lang.Object obj)
           
protected  boolean equalsImpl(NumericDataType other)
           
 void validateDefaultValue(java.lang.Object defaultValue, DataTypeUsage dataTypeUsage, DBObject dbObject)
          Validates defaultValue for dataTypeUsage against the declared precision, scale and min and max values of this numeric type.
 void validateUsage(DataTypeUsage dataTypeUsage, DBObject dbObject)
          Validates dataTypeUsage against self's definition.
 
Methods inherited from class oracle.javatools.db.datatypes.PredefinedDataType
addAttribute, addAttribute, copyToImpl, createDefaultUsage, createUsage, createUsage, equalsImpl, getDataTypeAttribute, getDataTypeAttributes, getDDL, getParent, getType, hasDataTypeAttribute, matches, parseDefaultValue, removeAttribute, tokenize, validateDefinition
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyToImpl, equalsImpl, 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
 

Field Detail

UNSIGNED

public static final DataTypeAttribute UNSIGNED
Standard definition of UNSIGNED data type attribute


MIN_MAX_BIGINT

public static final NumericDataType.MinMaxValue MIN_MAX_BIGINT
Standard definitions of integer MinMaxValues.


MIN_MAX_INT

public static final NumericDataType.MinMaxValue MIN_MAX_INT

MIN_MAX_MEDIUMINT

public static final NumericDataType.MinMaxValue MIN_MAX_MEDIUMINT

MIN_MAX_SMALLINT

public static final NumericDataType.MinMaxValue MIN_MAX_SMALLINT

MIN_MAX_SIGNED_TINYINT

public static final NumericDataType.MinMaxValue MIN_MAX_SIGNED_TINYINT

MIN_MAX_UNSIGNED_TINYINT

public static final NumericDataType.MinMaxValue MIN_MAX_UNSIGNED_TINYINT

MIN_MAX_MONEY

public static final NumericDataType.MinMaxValue MIN_MAX_MONEY

MIN_MAX_SMALLMONEY

public static final NumericDataType.MinMaxValue MIN_MAX_SMALLMONEY

MIN_MAX_BIT

public static final NumericDataType.MinMaxValue MIN_MAX_BIT
Constructor Detail

NumericDataType

public NumericDataType()

NumericDataType

public NumericDataType(int domain,
                       java.lang.String name,
                       NumericDataType.MinMaxValue minMaxValues)
Use this constructor when the data type is a simple name with no declarable attributes, e.g. Oracle integer and the floating-point(approximate) number types REAL and DOUBLE PRECISION. minMaxValues is used by validateDefaultValue().

Parameters:
domain - : Context of data type definition, e.g. column, variable. Domains are specific to each database and are defined in their interface.
name - : data type name
minMaxValues - : the min and max permissible value for this type

NumericDataType

public NumericDataType(int domain,
                       java.lang.String name,
                       java.lang.String definition,
                       DataTypeAttribute[] attributes,
                       NumericDataType.MinMaxValue minMaxValues)
Use this constructor when the data type has declarable attributes, e.g. Adaptive Server Anywhere [<unsigned>]BIGINT minMaxValues is used by validateDefaultValue().

Parameters:
domain - : Context of data type definition, e.g. column, variable. Domains are specific to each database and are defined in their interface.
name - : data type name
definition - : BNF definition of this data type
attributes - : definitions of this type's attributes
minMaxValues - : the min and max permissible value for this type

NumericDataType

public NumericDataType(int domain,
                       java.lang.String name,
                       java.lang.String definition,
                       long minPrecision,
                       long maxPrecision,
                       java.lang.Long defaultPrecision,
                       boolean isPrecisionMandatory,
                       DataTypeAttribute[] attributes,
                       NumericDataType.MinMaxValue minMaxValues)
Use this constructor when the datatype has declarable precision, e.g. Oracle FLOAT(<precision>). Add additional attributes with the attributes parameter. For fixed-point number types, defaultPrecision should be non-zero, and minMaxValues should be null as the minumum and maximum permissible default value for the type is determined by the declared or default precision. If you do supply minMaxValues for a fixed-point number type it will be used for default value validation instead of minPrecision and maxPrecision. For floating-point number types, defaultPrecision should be null, and minMaxValues specified.

Parameters:
domain - : Context of data type definition, e.g. column, variable. Domains are specific to each database and are defined in their interface.
name - : data type name
definition - : BNF definition of this data type
minPrecision - : the minimum declarable precision of the data type
maxPrecision - : the maximum declarable precision of the data type
defaultPrecision - : default precision for optional fixed-point numbers, default precision for initialising UI of mandatory fixed-point numbers, null for floating-point numbers.
isPrecisionMandatory - : TRUE if the precision must be specified
attributes - : definitions of additional attributes
minMaxValues - : the min and max permissible value for this type

NumericDataType

public NumericDataType(int domain,
                       java.lang.String name,
                       java.lang.String definition,
                       long minPrecision,
                       long maxPrecision,
                       java.lang.Long defaultPrecision,
                       boolean isPrecisionMandatory,
                       long minScale,
                       java.lang.Long maxScale,
                       java.lang.Long defaultScale,
                       boolean isScaleMandatory,
                       DataTypeAttribute[] attributes,
                       NumericDataType.MinMaxValue minMaxValues)
Use this constructor when the number type has declarable precision and scale, e.g. Oracle NUMBER and SQL Server DECIMAL. Add additional attributes with the attributes parameter. For fixed-point number types, defaultPrecision should be non-zero, and minMaxValues should be null as the minumum and maximum permissible default value for the type is determined by the declared or default precision. If you do supply minMaxValues for a fixed-point number type it will be used for default value validation instead of minPrecision and maxPrecision. For floating-point number types, defaultPrecision should be null, and minMaxValues specified. Beware of number types like Oracle's NUMBER which are fixed-point when declared with precision (and scale), and floating point when declared with neither. In this case defaultPrecision should be null, defaultScale should be the scale when not declared, and minValue and maxValue be specified.

Parameters:
domain - : Context of data type definition, e.g. column, variable. Domains are specific to each database and are defined in their interface.
name - : data type name
definition - : BNF definition of this data type
minPrecision - : the minimum declarable precision of the data type
maxPrecision - : the maximum declarable precision of the data type
defaultPrecision - : default precision for optional fixed-point numbers, default precision for initialising UI of mandatory exact numbers, null for floating-point numbers.
isPrecisionMandatory - : TRUE if the precision must be specified
minScale - : the minimum declarable scale of the data type
maxScale - : the maximum declarable scale of the data type, or null if s <= p
defaultScale - : default scale for optional exact numbers, default scale for initialising UI of mandatory exact numbers, null for approximate numbers.
isScaleMandatory - : TRUE if the scale must be specified
attributes - : definitions of additional attributes
minMaxValues - : the min and max permissible value for this type
Method Detail

copyTo

public DBObject copyTo(DBObject target,
                       DBObject copyParent,
                       IDPolicy idPolicy)
Description copied from class: AbstractDBObject
Internal copy method used by the API to perform copy operations. All objects must implement this method if they are instantiable objects. Abstract objects (e.g. Relation) must NOT implement this method. The implementation should delegate to the copyToImpl method to copy the actual properties.

This method does not fix internal reference ids on copy. That is done by the calling DBObject.copyTo(DBObject, IDPolicy) method.

Overrides:
copyTo in class PredefinedDataType
See Also:
DBObject.copyTo(java.lang.Object), DBObject.copyTo(DBObject, boolean), AbstractDBObject.copyToImpl(oracle.javatools.db.AbstractDBObject, oracle.javatools.db.DBObject, oracle.javatools.db.IDPolicy)

copyToImpl

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class PredefinedDataType

equalsImpl

protected boolean equalsImpl(NumericDataType other)

validateUsage

public 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. Method should be overridden by sub-classes to do sub-class validation.

Specified by:
validateUsage in interface DataType
Overrides:
validateUsage in class PredefinedDataType
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
Validates defaultValue for dataTypeUsage against the declared precision, scale and min and max values of this numeric type.

Specified by:
validateDefaultValue in interface DataType
Overrides:
validateDefaultValue in class PredefinedDataType
Parameters:
dataTypeUsage - : the usage to be validated
defaultValue - : the default value
dbObject - : the context of the data type usage
Throws:
DataTypeValidationException
DefaultValueValidationException

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

E13403-04

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