org.objectweb.jorm.mapper.rdb.adapter.api
Interface TypeAdapter

All Known Subinterfaces:
RdbAdapter, RdbAdapter
All Known Implementing Classes:
BasicRdbAdapter

public interface TypeAdapter

The supported type in the adapter.

Author:
S.Chassande-Barrioz

Field Summary
static java.lang.String[] TYPE_NAMES
          the name of the types TYPE_NAMES[TYPECODE_XXX]
static short TYPECODE_ARRAY
           
static short TYPECODE_BIGDECIMAL
          Defines the java.util.BigDecimal type.
static short TYPECODE_BIGINTEGER
          Defines the java.util.BigInteger type.
static short TYPECODE_BOOLEAN
          Defines the boolean type.
static short TYPECODE_BYTE
          Defines the byte type.
static short TYPECODE_BYTEARRAY
          Defines the byte[] type.
static short TYPECODE_CHAR
          Defines the char type.
static short TYPECODE_CHARARRAY
          Defines the char[] type.
static short TYPECODE_DATE
          Defines the java.util.Date type.
static short TYPECODE_DOUBLE
          Defines the double type.
static short TYPECODE_FLOAT
          Defines the float type.
static short TYPECODE_INT
          Defines the int type.
static short TYPECODE_LONG
          Defines the long type.
static short TYPECODE_OBJBOOLEAN
          Defines the java.lang.Boolean type.
static short TYPECODE_OBJBYTE
          Defines the java.lang.Character type.
static short TYPECODE_OBJCHAR
          Defines the java.lang.Boolean type.
static short TYPECODE_OBJDOUBLE
          Defines the java.lang.Double type.
static short TYPECODE_OBJFLOAT
          Defines the java.lang.Float type.
static short TYPECODE_OBJINT
          Defines the java.lang.Integer type.
static short TYPECODE_OBJLONG
          Defines the java.lang.Long type.
static short TYPECODE_OBJSHORT
          Defines the java.lang.Short type.
static short TYPECODE_SERIALIZED
          Defines the java.io.Serializable type.
static short TYPECODE_SHORT
          Defines the short type.
static short TYPECODE_STRING
          Defines the java.lang.String type.
 
Method Summary
 java.lang.String getSqlType(int typeCode, boolean usedInPK, int size, int scale)
          This method returns the SQL type linked to the java type
 int getSqlTypeCode(int typeCode)
          This method returns the SQL type code linked to the java type specified in parameter.
 int getSqlTypeCode(int typeCode, java.lang.String sqlColumnType)
          This method returns the SQL type code linked to the java type specified in parameter.
 boolean supportArray(int elemTypeCode)
           
 

Field Detail

TYPECODE_BOOLEAN

public static final short TYPECODE_BOOLEAN
Defines the boolean type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_CHAR

public static final short TYPECODE_CHAR
Defines the char type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_BYTE

public static final short TYPECODE_BYTE
Defines the byte type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_SHORT

public static final short TYPECODE_SHORT
Defines the short type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_INT

public static final short TYPECODE_INT
Defines the int type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_LONG

public static final short TYPECODE_LONG
Defines the long type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_FLOAT

public static final short TYPECODE_FLOAT
Defines the float type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_DOUBLE

public static final short TYPECODE_DOUBLE
Defines the double type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_OBJBOOLEAN

public static final short TYPECODE_OBJBOOLEAN
Defines the java.lang.Boolean type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_OBJCHAR

public static final short TYPECODE_OBJCHAR
Defines the java.lang.Boolean type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_OBJBYTE

public static final short TYPECODE_OBJBYTE
Defines the java.lang.Character type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_OBJSHORT

public static final short TYPECODE_OBJSHORT
Defines the java.lang.Short type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_OBJINT

public static final short TYPECODE_OBJINT
Defines the java.lang.Integer type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_OBJLONG

public static final short TYPECODE_OBJLONG
Defines the java.lang.Long type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_OBJFLOAT

public static final short TYPECODE_OBJFLOAT
Defines the java.lang.Float type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_OBJDOUBLE

public static final short TYPECODE_OBJDOUBLE
Defines the java.lang.Double type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_STRING

public static final short TYPECODE_STRING
Defines the java.lang.String type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_DATE

public static final short TYPECODE_DATE
Defines the java.util.Date type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_CHARARRAY

public static final short TYPECODE_CHARARRAY
Defines the char[] type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_BYTEARRAY

public static final short TYPECODE_BYTEARRAY
Defines the byte[] type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_SERIALIZED

public static final short TYPECODE_SERIALIZED
Defines the java.io.Serializable type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_BIGINTEGER

public static final short TYPECODE_BIGINTEGER
Defines the java.util.BigInteger type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_BIGDECIMAL

public static final short TYPECODE_BIGDECIMAL
Defines the java.util.BigDecimal type. If you modify this value, beware about the jorm type

See Also:
Constant Field Values

TYPECODE_ARRAY

public static final short TYPECODE_ARRAY
See Also:
Constant Field Values

TYPE_NAMES

public static final java.lang.String[] TYPE_NAMES
the name of the types TYPE_NAMES[TYPECODE_XXX]

Method Detail

getSqlType

public java.lang.String getSqlType(int typeCode,
                                   boolean usedInPK,
                                   int size,
                                   int scale)
                            throws RdbAdapterException
This method returns the SQL type linked to the java type

Parameters:
typeCode - is the type code of the java type
usedInPK - indicates if the type has to be used into a Primary key
size - can indicates the expected size of the type. If it equals to NO_SIZE that means no size is expected. This parameter can be used for float, BigXXX numbers, String,...
scale - can indicates the expected scale of the type. If it equals to NO_SIZE that means no scale is expected.
Throws:
RdbAdapterException

getSqlTypeCode

public int getSqlTypeCode(int typeCode)
                   throws RdbAdapterException
This method returns the SQL type code linked to the java type specified in parameter.

Returns:
An int constant defined in the java.sql.Types class
Throws:
RdbAdapterException

getSqlTypeCode

public int getSqlTypeCode(int typeCode,
                          java.lang.String sqlColumnType)
                   throws RdbAdapterException
This method returns the SQL type code linked to the java type specified in parameter.

Returns:
An int constant defined in the java.sql.Types class
Throws:
RdbAdapterException

supportArray

public boolean supportArray(int elemTypeCode)