org.eclipse.datatools.connectivity.oda.util.manifest
Class DataTypeMapping

java.lang.Object
  extended by org.eclipse.datatools.connectivity.oda.util.manifest.DataTypeMapping

public class DataTypeMapping
extends java.lang.Object

The data type mapping of a data provider's native data type to one or more ODA data types. A single native data type must be mapped to a primary ODA scalar data type. The driver can optionally provide a list of alternate ODA data types to which it is capable of converting the native data type.


Field Summary
static int[] ODA_BOOLEAN_DATA_TYPE_CODES
           
static int[] ODA_DATETIME_DATA_TYPE_CODES
           
static int[] ODA_NUMERIC_DATA_TYPE_CODES
           
static int[] ODA_STRING_DATA_TYPE_CODES
           
 
Method Summary
 boolean canConvertToOdaType(int odaDataTypeCode)
          A convenient method to indicate whether the ODA data provider is capable of converting this mapping's native data type to the specified ODA data type code.
 int[] getAlternativeOdaDataTypeCodes()
          Returns the alternative ODA data type codes of the data type mapping, or an empty array if no alternative ODA data types exist.
 java.lang.String[] getAlternativeOdaDataTypes()
          Returns the alternative ODA data types of the data type mapping, or an empty array if no alternative ODA data types exist.
 java.lang.String getNativeType()
          Returns the native type name of the data type mapping.
 int getNativeTypeCode()
          Returns the native type code of the data type mapping.
static int getOdaDataTypeCodeOfObject(java.lang.Object valueObj)
          Returns the default ODA data type code of the specified value based on its object type.
 java.lang.String getOdaScalarDataType()
          Returns the primary ODA scalar data type that the native data type maps to
 int getOdaScalarDataTypeCode()
          Returns the primary ODA scalar data type code that the native data type maps to.
static int toOdaDataTypeCode(java.lang.String odaDataTypeLiteral)
          Converts an ODA data type literal value to its corresponding code value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ODA_NUMERIC_DATA_TYPE_CODES

public static final int[] ODA_NUMERIC_DATA_TYPE_CODES

ODA_STRING_DATA_TYPE_CODES

public static final int[] ODA_STRING_DATA_TYPE_CODES

ODA_DATETIME_DATA_TYPE_CODES

public static final int[] ODA_DATETIME_DATA_TYPE_CODES

ODA_BOOLEAN_DATA_TYPE_CODES

public static final int[] ODA_BOOLEAN_DATA_TYPE_CODES
Method Detail

getNativeType

public java.lang.String getNativeType()
Returns the native type name of the data type mapping.

Returns:
the native type name.

getNativeTypeCode

public int getNativeTypeCode()
Returns the native type code of the data type mapping. Its value must match one of the data type codes returned in the driver's ODA interface implementation.

Returns:
the native type code.

getOdaScalarDataType

public java.lang.String getOdaScalarDataType()
Returns the primary ODA scalar data type that the native data type maps to

Returns:
the primary ODA scalar data type.

getOdaScalarDataTypeCode

public int getOdaScalarDataTypeCode()
Returns the primary ODA scalar data type code that the native data type maps to.

Returns:
the primary ODA scalar data type code.

getAlternativeOdaDataTypes

public java.lang.String[] getAlternativeOdaDataTypes()
Returns the alternative ODA data types of the data type mapping, or an empty array if no alternative ODA data types exist.

Returns:
the alternative ODA data types, or an empty array if no alternative ODA data types exist.

getAlternativeOdaDataTypeCodes

public int[] getAlternativeOdaDataTypeCodes()
Returns the alternative ODA data type codes of the data type mapping, or an empty array if no alternative ODA data types exist.

Returns:
the alternative ODA data type codes, or an empty array if no alternative ODA data types exist.

canConvertToOdaType

public boolean canConvertToOdaType(int odaDataTypeCode)
A convenient method to indicate whether the ODA data provider is capable of converting this mapping's native data type to the specified ODA data type code.

Parameters:
odaDataTypeCode - an ODA data type code
Returns:
true if the specified ODA data type can be converted from this mapping's native data type; false otherwise.

toOdaDataTypeCode

public static int toOdaDataTypeCode(java.lang.String odaDataTypeLiteral)
Converts an ODA data type literal value to its corresponding code value.

Parameters:
odaDataTypeLiteral - a literal value of an ODA data type
Returns:
corresponding ODA data type code value, or Types.NULL if specified literal value is not recognized

getOdaDataTypeCodeOfObject

public static int getOdaDataTypeCodeOfObject(java.lang.Object valueObj)
Returns the default ODA data type code of the specified value based on its object type.

Parameters:
valueObj - a value object
Returns:
an ODA data type code; may be Types.NULL for unknown data type
Since:
3.2.2 (DTP 1.7.2)