com.im.commons.db 5.9.2

com.im.commons.db.ddl
Interface DBDatabaseInfo.NativeType

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractDBInfo.PlatformNativeType
Enclosing interface:
DBDatabaseInfo

public static interface DBDatabaseInfo.NativeType
extends Serializable

Represents a database column native type.


Method Summary
 String columnDefinition()
          Our current column definition e.g.
 DBDatabaseInfo.ColumnSQLType geColumnType()
          Column type as one of the DBDatabaseInfo.ColumnSQLType enum values.
 String getColumnDefinitionMesageFormat()
          Get a MessageFormat string that can be used to generate the column definition based on the native type, the length and the scale.
 int getJdbcType()
           
 int getLength()
          The length (size) of this column.
 Integer getMaxAllowedLength()
          The maximum allowed length for this column.
 Integer getMaxAllowedScale()
          The maximum allowed scale for this column.
 Integer getMinAllowedLength()
          The minimum allowed length for this column.
 Integer getMinAllowedScale()
          The minimum allowed scale for this column.
 String getNativeType()
          The column type in string form e.g.
 int getScale()
          The scale (precision) of this column.
 boolean hasLength()
          Does this column have a length.
 boolean hasScale()
          Does this column have a scale.
 boolean isLengthSpecified()
          Has length been specified upon table creation.
 boolean isRescalingSupported()
           
 boolean isResizingSupported()
          Can the length of this column be changed.
 boolean isScaleSpecified()
          Has scale been specified upon table creation.
 boolean isSupported()
          Is this a supported DIF datatype.
 DBDatabaseInfo.NativeType reScale(int newScale)
          Create a new NativeType of this new scale.
 DBDatabaseInfo.NativeType reSize(int newLength)
          Create a new NativeType of this new length.
 

Method Detail

getJdbcType

int getJdbcType()

getNativeType

String getNativeType()
The column type in string form e.g. VARCHAR. This will always be defined.


geColumnType

DBDatabaseInfo.ColumnSQLType geColumnType()
Column type as one of the DBDatabaseInfo.ColumnSQLType enum values. This may not be defined if it is not a DIF supported column type.


getLength

int getLength()
The length (size) of this column. Use the hasLength() method to first determine if the column has a length.

Returns:
The length.

hasLength

boolean hasLength()
Does this column have a length.

Returns:
True if the column has a length attribute

isLengthSpecified

boolean isLengthSpecified()
Has length been specified upon table creation.


isScaleSpecified

boolean isScaleSpecified()
Has scale been specified upon table creation.


getMinAllowedLength

Integer getMinAllowedLength()
The minimum allowed length for this column. If null then the minimum is unspecified, and is probably dependent on the underlying platform

Returns:
The min length

getMaxAllowedLength

Integer getMaxAllowedLength()
The maximum allowed length for this column. If null then the maximum is unspecified, and is probably dependent on the underlying platform

Returns:
The max length

isResizingSupported

boolean isResizingSupported()
Can the length of this column be changed.


reSize

DBDatabaseInfo.NativeType reSize(int newLength)
Create a new NativeType of this new length. All other parameters are unchanged

Parameters:
newLength - The new length for the column
Returns:
A new NativeType with the size adjusted

getScale

int getScale()
The scale (precision) of this column. Use the hasScale() method to first determine if the column has a scale.

Returns:
The length.

hasScale

boolean hasScale()
Does this column have a scale.

Returns:
True if the column has a scale attribute

getMinAllowedScale

Integer getMinAllowedScale()
The minimum allowed scale for this column. If null then the minimum is unspecified, and is probably dependent on the underlying platform

Returns:
The min scale

getMaxAllowedScale

Integer getMaxAllowedScale()
The maximum allowed scale for this column. If null then the maximum is unspecified, and is probably dependent on the underlying platform

Returns:
The max scale

isRescalingSupported

boolean isRescalingSupported()
Returns:
Can the scale of this column be changed

reScale

DBDatabaseInfo.NativeType reScale(int newScale)
Create a new NativeType of this new scale. All other parameters are unchanged

Parameters:
newScale - The new scale for the column
Returns:
A new NativeType with the scale adjusted

columnDefinition

String columnDefinition()
Our current column definition e.g. NUMBER(10.2) or VARCHAR2(255)


isSupported

boolean isSupported()
Is this a supported DIF datatype.


getColumnDefinitionMesageFormat

String getColumnDefinitionMesageFormat()
Get a MessageFormat string that can be used to generate the column definition based on the native type, the length and the scale. e.g. VARCHAR(100)

Returns:
The MessageFormat string

com.im.commons.db 5.9.2