com.im.commons.db 5.9.2

com.im.commons.db.ddl
Class AbstractDBInfo.PlatformNativeType

java.lang.Object
  extended by com.im.commons.db.ddl.AbstractDBInfo.PlatformNativeType
All Implemented Interfaces:
DBDatabaseInfo.NativeType, Serializable
Enclosing class:
AbstractDBInfo

public static final class AbstractDBInfo.PlatformNativeType
extends Object
implements DBDatabaseInfo.NativeType, Serializable

See Also:
Serialized Form

Constructor Summary
AbstractDBInfo.PlatformNativeType(int jdbcType, String nativeType, int length, int scale, String formatString)
           
AbstractDBInfo.PlatformNativeType(int jdbcType, String nativeType, int length, String formatString)
           
 
Method Summary
 String columnDefinition()
          Our current column definition e.g.
 String columnDefinition(int size, int scale)
           
 boolean equals(Object obj)
           
 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.
 int getSize()
          Deprecated. Use getLength()
 int hashCode()
           
 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.
 void setScale(int scale)
           
 void setSize(int size)
          Deprecated. Use reSize()
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDBInfo.PlatformNativeType

public AbstractDBInfo.PlatformNativeType(int jdbcType,
                                         String nativeType,
                                         int length,
                                         int scale,
                                         String formatString)

AbstractDBInfo.PlatformNativeType

public AbstractDBInfo.PlatformNativeType(int jdbcType,
                                         String nativeType,
                                         int length,
                                         String formatString)
Method Detail

getJdbcType

public int getJdbcType()
Specified by:
getJdbcType in interface DBDatabaseInfo.NativeType

getNativeType

public String getNativeType()
Description copied from interface: DBDatabaseInfo.NativeType
The column type in string form e.g. VARCHAR. This will always be defined.

Specified by:
getNativeType in interface DBDatabaseInfo.NativeType

geColumnType

public DBDatabaseInfo.ColumnSQLType geColumnType()
Description copied from interface: DBDatabaseInfo.NativeType
Column type as one of the DBDatabaseInfo.ColumnSQLType enum values. This may not be defined if it is not a DIF supported column type.

Specified by:
geColumnType in interface DBDatabaseInfo.NativeType

getSize

@Deprecated
public int getSize()
Deprecated. Use getLength()


setSize

@Deprecated
public void setSize(int size)
Deprecated. Use reSize()


getLength

public int getLength()
Description copied from interface: DBDatabaseInfo.NativeType
The length (size) of this column. Use the hasLength() method to first determine if the column has a length.

Specified by:
getLength in interface DBDatabaseInfo.NativeType
Returns:
The length.

hasLength

public boolean hasLength()
Description copied from interface: DBDatabaseInfo.NativeType
Does this column have a length.

Specified by:
hasLength in interface DBDatabaseInfo.NativeType
Returns:
True if the column has a length attribute

isLengthSpecified

public boolean isLengthSpecified()
Description copied from interface: DBDatabaseInfo.NativeType
Has length been specified upon table creation.

Specified by:
isLengthSpecified in interface DBDatabaseInfo.NativeType

isScaleSpecified

public boolean isScaleSpecified()
Description copied from interface: DBDatabaseInfo.NativeType
Has scale been specified upon table creation.

Specified by:
isScaleSpecified in interface DBDatabaseInfo.NativeType

getMinAllowedLength

public Integer getMinAllowedLength()
Description copied from interface: DBDatabaseInfo.NativeType
The minimum allowed length for this column. If null then the minimum is unspecified, and is probably dependent on the underlying platform

Specified by:
getMinAllowedLength in interface DBDatabaseInfo.NativeType
Returns:
The min length

getMaxAllowedLength

public Integer getMaxAllowedLength()
Description copied from interface: DBDatabaseInfo.NativeType
The maximum allowed length for this column. If null then the maximum is unspecified, and is probably dependent on the underlying platform

Specified by:
getMaxAllowedLength in interface DBDatabaseInfo.NativeType
Returns:
The max length

isResizingSupported

public boolean isResizingSupported()
Description copied from interface: DBDatabaseInfo.NativeType
Can the length of this column be changed.

Specified by:
isResizingSupported in interface DBDatabaseInfo.NativeType

reSize

public DBDatabaseInfo.NativeType reSize(int newLength)
Description copied from interface: DBDatabaseInfo.NativeType
Create a new NativeType of this new length. All other parameters are unchanged

Specified by:
reSize in interface DBDatabaseInfo.NativeType
Parameters:
newLength - The new length for the column
Returns:
A new NativeType with the size adjusted

getScale

public int getScale()
Description copied from interface: DBDatabaseInfo.NativeType
The scale (precision) of this column. Use the hasScale() method to first determine if the column has a scale.

Specified by:
getScale in interface DBDatabaseInfo.NativeType
Returns:
The length.

setScale

public void setScale(int scale)

hasScale

public boolean hasScale()
Description copied from interface: DBDatabaseInfo.NativeType
Does this column have a scale.

Specified by:
hasScale in interface DBDatabaseInfo.NativeType
Returns:
True if the column has a scale attribute

getMinAllowedScale

public Integer getMinAllowedScale()
Description copied from interface: DBDatabaseInfo.NativeType
The minimum allowed scale for this column. If null then the minimum is unspecified, and is probably dependent on the underlying platform

Specified by:
getMinAllowedScale in interface DBDatabaseInfo.NativeType
Returns:
The min scale

getMaxAllowedScale

public Integer getMaxAllowedScale()
Description copied from interface: DBDatabaseInfo.NativeType
The maximum allowed scale for this column. If null then the maximum is unspecified, and is probably dependent on the underlying platform

Specified by:
getMaxAllowedScale in interface DBDatabaseInfo.NativeType
Returns:
The max scale

isRescalingSupported

public boolean isRescalingSupported()
Specified by:
isRescalingSupported in interface DBDatabaseInfo.NativeType
Returns:
Can the scale of this column be changed

reScale

public DBDatabaseInfo.NativeType reScale(int newScale)
Description copied from interface: DBDatabaseInfo.NativeType
Create a new NativeType of this new scale. All other parameters are unchanged

Specified by:
reScale in interface DBDatabaseInfo.NativeType
Parameters:
newScale - The new scale for the column
Returns:
A new NativeType with the scale adjusted

columnDefinition

public String columnDefinition()
Description copied from interface: DBDatabaseInfo.NativeType
Our current column definition e.g. NUMBER(10.2) or VARCHAR2(255)

Specified by:
columnDefinition in interface DBDatabaseInfo.NativeType

columnDefinition

public String columnDefinition(int size,
                               int scale)

isSupported

public boolean isSupported()
Is this a supported DIF datatype.

Specified by:
isSupported in interface DBDatabaseInfo.NativeType

getColumnDefinitionMesageFormat

public String getColumnDefinitionMesageFormat()
Description copied from interface: DBDatabaseInfo.NativeType
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)

Specified by:
getColumnDefinitionMesageFormat in interface DBDatabaseInfo.NativeType
Returns:
The MessageFormat string

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

com.im.commons.db 5.9.2