Extension SDK 9.0.5

oracle.jdeveloper.cm.ds.db
Class DataType

java.lang.Object
  extended byoracle.jdeveloper.cm.ds.db.DataType

public final class DataType
extends java.lang.Object

A database data type.

Since:
9.0

Field Summary
static int BINARY_TYPE
          Category for DataTypes representing binary data.
static int CHARACTER_TYPE
          Category for DataTypes representing character data.
static int DATETIME_TYPE
          Category for DataTypes representing date and/or time data.
static int LOB_TYPE
          Category for DataTypes representing Large Objects (LOBs).
static int NUMERIC_TYPE
          Category for DataTypes representing numeric data.
static int ROWID_TYPE
          Category for DataTypes representing a rowid.
static int USER_TYPE
          Category for DataTypes representing a user-defined type.
 
Method Summary
static DataType createBinaryType(java.lang.String typeName, long maxSize)
          Creates a new DataType representing binary data.
static DataType createBinaryType(java.lang.String typeName, long maxSize, boolean sizeSupported, boolean needSize)
          Creates a new DataType representing binary data.
static DataType createCharacterDataType(java.lang.String typeName, long maxSize)
          Creates a new DataType representing character data.
static DataType createCharacterDataType(java.lang.String typeName, long maxSize, boolean sizeSupported, boolean needSize)
          Creates a new DataType representing character data.
static DataType createDatetimeType(java.lang.String typeName)
          Creates a new DataType representing date/time data.
static DataType createDatetimeType(java.lang.String typeName, long maxSize)
          Creates a new DataType representing date/time data.
static DataType createLOBType(java.lang.String typeName, long maxSize)
          Creates a new DataType representing LOB data.
static DataType createNumericType(java.lang.String typeName, long maxPrecision, boolean needPrecision, long minScale, long maxScale)
          Creates a new DataType representing numeric data.
static DataType createRowidType(java.lang.String typeName, long maxSize)
          Creates a new DataType representing rowid data.
static DataType createUserType(java.lang.String typeName)
          Creates a new DataType representing a user-defined type.
static DataType createUserType(java.lang.String typeName, boolean allowPrec, boolean precisionRequired, boolean allowScale, long maxPrecision, long minScale, long maxScale)
          Creates a new DataType representing a user-defined type.
 boolean equals(java.lang.Object target)
           
protected  boolean equalsImpl(DataType target)
           
 long getMaxPrecision()
          Retrieves the maximum allowable precision or size for this datatype.
 long getMaxScale()
          Retrieves the maximum scale allowed by this datatype.
 long getMinScale()
          Retrieves the minimum scale allowed by this datatype.
 java.lang.String getName()
          Retrieves the name of the datatype.
 int getTypeCategory()
          Retrieves the category of this datatype.
 boolean isAllowPrecision()
          Whether this datatype allows the precision or size to be specified.
 boolean isAllowScale()
          Whether this datatype allows the scale to be specified.
 boolean isPrecisionRequired()
          Whether this datatype needs the precision or size to be specified.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CHARACTER_TYPE

public static final int CHARACTER_TYPE
Category for DataTypes representing character data. VARCHAR2 is an example of a character type in Oracle.

See Also:
getTypeCategory, Constant Field Values

NUMERIC_TYPE

public static final int NUMERIC_TYPE
Category for DataTypes representing numeric data. NUMBER is an example of a numeric type in Oracle.

See Also:
getTypeCategory, Constant Field Values

BINARY_TYPE

public static final int BINARY_TYPE
Category for DataTypes representing binary data. RAW is an example of a binary type in Oracle.

See Also:
getTypeCategory, Constant Field Values

DATETIME_TYPE

public static final int DATETIME_TYPE
Category for DataTypes representing date and/or time data. DATE is an example of a datetime type in Oracle.

See Also:
getTypeCategory, Constant Field Values

ROWID_TYPE

public static final int ROWID_TYPE
Category for DataTypes representing a rowid. ROWID is an example of a rowid type in Oracle.

See Also:
getTypeCategory, Constant Field Values

LOB_TYPE

public static final int LOB_TYPE
Category for DataTypes representing Large Objects (LOBs). CLOB is an example of a LOB type in Oracle.

See Also:
getTypeCategory, Constant Field Values

USER_TYPE

public static final int USER_TYPE
Category for DataTypes representing a user-defined type. Object Types in Oracle are an example of user types.

See Also:
getTypeCategory, Constant Field Values
Method Detail

createCharacterDataType

public static DataType createCharacterDataType(java.lang.String typeName,
                                               long maxSize,
                                               boolean sizeSupported,
                                               boolean needSize)
Creates a new DataType representing character data.

Parameters:
typeName - the name of the datatype
maxSize - the maximum size allowed for a column of this type. If sizeSupported is false, then the maximum size only applies to the data in the column; otherwise, it also applies to the maximum size allowed when creating a column.
sizeSupported - whether size can be specified when declaring a column using this type
needSize - whether size must be specified when declaring a column using this type
Returns:
a new DataType instance

createCharacterDataType

public static DataType createCharacterDataType(java.lang.String typeName,
                                               long maxSize)
Creates a new DataType representing character data. The type is assumed to not allow size to be specified in a column declaration using the type.

Parameters:
typeName - the name of the datatype
maxSize - the maximum size allowed for data in column of this type
Returns:
a new DataType instance

createNumericType

public static DataType createNumericType(java.lang.String typeName,
                                         long maxPrecision,
                                         boolean needPrecision,
                                         long minScale,
                                         long maxScale)
Creates a new DataType representing numeric data.

Parameters:
typeName - the name of the datatype
maxPrecision - the maximum precision allowed for a column of this type. If maxPrecision == 0, then the type does not allow the specification of a precision.
needPrecision - whether precision must be specified when declaring a column using this type
minScale - the minimum scale for this numeric type
maxScale - the maximum scale for this numeric type. If minScale >= maxScale, scale is not supported.
Returns:
a new DataType instance

createBinaryType

public static DataType createBinaryType(java.lang.String typeName,
                                        long maxSize,
                                        boolean sizeSupported,
                                        boolean needSize)
Creates a new DataType representing binary data.

Parameters:
typeName - the name of the datatype
maxSize - the maximum size allowed for a column of this type. If sizeSupported is false, then the maximum size only applies to the data in the column; otherwise, it also applies to the maximum size allowed when creating a column.
sizeSupported - whether size can be specified when declaring a column using this type
needSize - whether size must be specified when declaring a column using this type
Returns:
a new DataType instance

createBinaryType

public static DataType createBinaryType(java.lang.String typeName,
                                        long maxSize)
Creates a new DataType representing binary data. Size cannot be specified for this type.

Parameters:
typeName - the name of the datatype
maxSize - the maximum size allowed for data in a column of this type
Returns:
a new DataType instance

createDatetimeType

public static DataType createDatetimeType(java.lang.String typeName)
Creates a new DataType representing date/time data.

Parameters:
typeName - the name of the datatype
Returns:
a new DataType instance

createDatetimeType

public static DataType createDatetimeType(java.lang.String typeName,
                                          long maxSize)
Creates a new DataType representing date/time data.

Parameters:
typeName - the name of the datatype
maxSize - the maximum size allowed for a column of this type
Returns:
a new DataType instance

createRowidType

public static DataType createRowidType(java.lang.String typeName,
                                       long maxSize)
Creates a new DataType representing rowid data.

Parameters:
typeName - the name of the datatype
maxSize - the maximum size allowed for a column of this type. If maxSize > 0, the datatype can have a size specified, but it is not required.
Returns:
a new DataType instance

createLOBType

public static DataType createLOBType(java.lang.String typeName,
                                     long maxSize)
Creates a new DataType representing LOB data.

Parameters:
typeName - the name of the datatype
maxSize - the maximum size allowed for a column of this type
Returns:
a new DataType instance

createUserType

public static DataType createUserType(java.lang.String typeName)
Creates a new DataType representing a user-defined type.

Parameters:
typeName - the name of the datatype
Returns:
a new DataType instance

createUserType

public static DataType createUserType(java.lang.String typeName,
                                      boolean allowPrec,
                                      boolean precisionRequired,
                                      boolean allowScale,
                                      long maxPrecision,
                                      long minScale,
                                      long maxScale)
Creates a new DataType representing a user-defined type.

Parameters:
typeName - the name of the datatype
allowPrec - a boolean indicating whether the type allows precision to be specified
precisionRequired - a boolean indicating whether the type needs precision and scale to be specified
allowScale - a boolean indicating whether the type allows scale to be specified
maxPrecision - a long indicating the maximum allowable precision or size.
minScale - a long indicating the minimum allowable scale.
maxScale - a long indicating the maximum allowable scale.
Returns:
a new DataType instance

equals

public boolean equals(java.lang.Object target)

equalsImpl

protected boolean equalsImpl(DataType target)

getName

public final java.lang.String getName()
Retrieves the name of the datatype.

Returns:
a string containing the name of this datatype.

isAllowPrecision

public final boolean isAllowPrecision()
Whether this datatype allows the precision or size to be specified.

Returns:
a boolean value indicating whether this datatype supports the specification of precision or size.

isPrecisionRequired

public final boolean isPrecisionRequired()
Whether this datatype needs the precision or size to be specified.

Returns:
a boolean value indicating whether this datatype requires the specification of precision or size.

isAllowScale

public final boolean isAllowScale()
Whether this datatype allows the scale to be specified.

Returns:
a boolean value indicating whether this datatype supports the specification of scale.

getMaxPrecision

public final long getMaxPrecision()
Retrieves the maximum allowable precision or size for this datatype. For a numeric type, the precision is the maximum number of digits stored; for other types, the size may indicate a maximum length or, in some cases, a fixed size.

Returns:
a long value indicating the maximum allowable precision.

getMinScale

public final long getMinScale()
Retrieves the minimum scale allowed by this datatype. For numeric types, the scale determines where rounding occurs. An integer, for example, would have a scale of 0. For character, date, and binary types, the scale is not applicable. The minimum scale is the smallest value allowed with declarations of this type.

Returns:
a long value indicating the minimum allowable scale

getMaxScale

public final long getMaxScale()
Retrieves the maximum scale allowed by this datatype. For numeric types, the scale determines where rounding occurs. An integer, for example, would have a scale of 0. For character, date, and binary types, the scale is not applicable. The maximum scale is the largest value allowed with declarations of this type.

Returns:
a long value indicating the maximum allowable scale

getTypeCategory

public int getTypeCategory()
Retrieves the category of this datatype.


toString

public java.lang.String toString()

Extension SDK

 

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