|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.torque.engine.database.model.TypeMap
public class TypeMap
A class that maps JDBC types to their corresponding Java object types, and Java native types. Used by Column.java to perform object/native mappings. These are the official SQL type to Java type mappings. These don't quite correspond to the way the peer system works so we'll have to make some adjustments.
------------------------------------------------------- SQL Type | Java Type | Peer Type ------------------------------------------------------- CHAR | String | String VARCHAR | String | String LONGVARCHAR | String | String NUMERIC | java.math.BigDecimal | java.math.BigDecimal DECIMAL | java.math.BigDecimal | java.math.BigDecimal BIT | boolean OR Boolean | Boolean TINYINT | byte OR Byte | Byte SMALLINT | short OR Short | Short INTEGER | int OR Integer | Integer BIGINT | long OR Long | Long REAL | float OR Float | Float FLOAT | double OR Double | Double DOUBLE | double OR Double | Double BINARY | byte[] | ? VARBINARY | byte[] | ? LONGVARBINARY | byte[] | ? DATE | java.sql.Date | java.util.Date TIME | java.sql.Time | java.util.Date TIMESTAMP | java.sql.Timestamp | java.util.Date ------------------------------------------------------- A couple variations have been introduced to cover cases that may arise, but are not covered above BOOLEANCHAR | boolean OR Boolean | String BOOLEANINT | boolean OR Boolean | Integer
Constructor Summary | |
---|---|
TypeMap()
|
Method Summary | |
---|---|
static String |
getJavaNative(SchemaType jdbcType)
Return native java type which corresponds to the JDBC type provided. |
static String |
getJavaNativeObject(SchemaType jdbcType)
Return native java type which corresponds to the JDBC type provided. |
static String |
getJavaObject(SchemaType jdbcType)
Return a Java object which corresponds to the JDBC type provided. |
static SchemaType |
getJdbcType(SchemaType type)
Deprecated. the type conversion is handled by the platform package (since torque 3.2) |
static String |
getPPMethod(SchemaType jdbcType)
Return ParameterParser getX() method which corresponds to the JDBC type provided. |
static SchemaType |
getTorqueType(Integer sqlType)
Returns Torque type constant corresponding to JDBC type code. |
static String |
getVillageMethod(SchemaType jdbcType)
Return Village asX() method which corresponds to the JDBC type provided. |
static String |
getVillageObjectMethod(SchemaType jdbcType)
Return Village asX() method which corresponds to the JDBC type provided. |
static void |
initialize()
Initializes the SQL to Java map so that it can be used by client code. |
static boolean |
isBit(SchemaType type)
Returns true if the type is boolean in the java object and a Bit "1" or "0" in the db. |
static boolean |
isBooleanChar(SchemaType type)
Returns true if the type is boolean in the java object and a String "Y" or "N" in the db. |
static boolean |
isBooleanInt(SchemaType type)
Returns true if the type is boolean in the java object and a numeric (1 or 0) in the db. |
static boolean |
isInitialized()
Report whether this object has been initialized. |
static boolean |
isTextType(SchemaType type)
Returns true if values for the type need to be quoted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CHAR_OBJECT_TYPE
public static final String VARCHAR_OBJECT_TYPE
public static final String LONGVARCHAR_OBJECT_TYPE
public static final String CLOB_OBJECT_TYPE
public static final String NUMERIC_OBJECT_TYPE
public static final String DECIMAL_OBJECT_TYPE
public static final String BIT_OBJECT_TYPE
public static final String TINYINT_OBJECT_TYPE
public static final String SMALLINT_OBJECT_TYPE
public static final String INTEGER_OBJECT_TYPE
public static final String BIGINT_OBJECT_TYPE
public static final String REAL_OBJECT_TYPE
public static final String FLOAT_OBJECT_TYPE
public static final String DOUBLE_OBJECT_TYPE
public static final String BINARY_OBJECT_TYPE
public static final String VARBINARY_OBJECT_TYPE
public static final String LONGVARBINARY_OBJECT_TYPE
public static final String BLOB_OBJECT_TYPE
public static final String DATE_OBJECT_TYPE
public static final String TIME_OBJECT_TYPE
public static final String TIMESTAMP_OBJECT_TYPE
public static final String BOOLEANCHAR_OBJECT_TYPE
public static final String BOOLEANINT_OBJECT_TYPE
public static final String CHAR_NATIVE_TYPE
public static final String VARCHAR_NATIVE_TYPE
public static final String LONGVARCHAR_NATIVE_TYPE
public static final String CLOB_NATIVE_TYPE
public static final String NUMERIC_NATIVE_TYPE
public static final String DECIMAL_NATIVE_TYPE
public static final String BIT_NATIVE_TYPE
public static final String TINYINT_NATIVE_TYPE
public static final String SMALLINT_NATIVE_TYPE
public static final String INTEGER_NATIVE_TYPE
public static final String BIGINT_NATIVE_TYPE
public static final String REAL_NATIVE_TYPE
public static final String FLOAT_NATIVE_TYPE
public static final String DOUBLE_NATIVE_TYPE
public static final String BINARY_NATIVE_TYPE
public static final String VARBINARY_NATIVE_TYPE
public static final String LONGVARBINARY_NATIVE_TYPE
public static final String BLOB_NATIVE_TYPE
public static final String DATE_NATIVE_TYPE
public static final String TIME_NATIVE_TYPE
public static final String TIMESTAMP_NATIVE_TYPE
public static final String BOOLEANCHAR_NATIVE_TYPE
public static final String BOOLEANINT_NATIVE_TYPE
public static final String BIT_NATIVE_OBJECT_TYPE
public static final String TINYINT_NATIVE_OBJECT_TYPE
public static final String SMALLINT_NATIVE_OBJECT_TYPE
public static final String INTEGER_NATIVE_OBJECT_TYPE
public static final String BIGINT_NATIVE_OBJECT_TYPE
public static final String REAL_NATIVE_OBJECT_TYPE
public static final String FLOAT_NATIVE_OBJECT_TYPE
public static final String DOUBLE_NATIVE_OBJECT_TYPE
public static final String BOOLEANCHAR_NATIVE_OBJECT_TYPE
public static final String BOOLEANINT_NATIVE_OBJECT_TYPE
public static final String CHAR_VILLAGE_METHOD
public static final String VARCHAR_VILLAGE_METHOD
public static final String LONGVARCHAR_VILLAGE_METHOD
public static final String CLOB_VILLAGE_METHOD
public static final String NUMERIC_VILLAGE_METHOD
public static final String DECIMAL_VILLAGE_METHOD
public static final String BIT_VILLAGE_METHOD
public static final String TINYINT_VILLAGE_METHOD
public static final String SMALLINT_VILLAGE_METHOD
public static final String INTEGER_VILLAGE_METHOD
public static final String BIGINT_VILLAGE_METHOD
public static final String REAL_VILLAGE_METHOD
public static final String FLOAT_VILLAGE_METHOD
public static final String DOUBLE_VILLAGE_METHOD
public static final String BINARY_VILLAGE_METHOD
public static final String VARBINARY_VILLAGE_METHOD
public static final String LONGVARBINARY_VILLAGE_METHOD
public static final String BLOB_VILLAGE_METHOD
public static final String DATE_VILLAGE_METHOD
public static final String TIME_VILLAGE_METHOD
public static final String TIMESTAMP_VILLAGE_METHOD
public static final String BOOLEANCHAR_VILLAGE_METHOD
public static final String BOOLEANINT_VILLAGE_METHOD
public static final String BIT_VILLAGE_OBJECT_METHOD
public static final String TINYINT_VILLAGE_OBJECT_METHOD
public static final String SMALLINT_VILLAGE_OBJECT_METHOD
public static final String INTEGER_VILLAGE_OBJECT_METHOD
public static final String BIGINT_VILLAGE_OBJECT_METHOD
public static final String REAL_VILLAGE_OBJECT_METHOD
public static final String FLOAT_VILLAGE_OBJECT_METHOD
public static final String DOUBLE_VILLAGE_OBJECT_METHOD
public static final String BOOLEANCHAR_VILLAGE_OBJECT_METHOD
public static final String BOOLEANINT_VILLAGE_OBJECT_METHOD
public static final String CHAR_PP_METHOD
public static final String VARCHAR_PP_METHOD
public static final String LONGVARCHAR_PP_METHOD
public static final String NUMERIC_PP_METHOD
public static final String DECIMAL_PP_METHOD
public static final String BIT_PP_METHOD
public static final String TINYINT_PP_METHOD
public static final String SMALLINT_PP_METHOD
public static final String INTEGER_PP_METHOD
public static final String BIGINT_PP_METHOD
public static final String REAL_PP_METHOD
public static final String FLOAT_PP_METHOD
public static final String DOUBLE_PP_METHOD
public static final String BINARY_PP_METHOD
public static final String VARBINARY_PP_METHOD
public static final String LONGVARBINARY_PP_METHOD
public static final String DATE_PP_METHOD
public static final String TIME_PP_METHOD
public static final String TIMESTAMP_PP_METHOD
public static final String BOOLEANCHAR_PP_METHOD
public static final String BOOLEANINT_PP_METHOD
Constructor Detail |
---|
public TypeMap()
Method Detail |
---|
public static void initialize()
public static boolean isInitialized()
public static String getJavaObject(SchemaType jdbcType)
jdbcType
- the JDBC type
public static String getJavaNative(SchemaType jdbcType)
jdbcType
- the JDBC type
public static String getJavaNativeObject(SchemaType jdbcType)
jdbcType
- the JDBC type
public static String getVillageMethod(SchemaType jdbcType)
jdbcType
- the JDBC type
public static String getVillageObjectMethod(SchemaType jdbcType)
jdbcType
- the JDBC type
public static String getPPMethod(SchemaType jdbcType)
jdbcType
- the JDBC type
public static SchemaType getJdbcType(SchemaType type)
type
- the torque added type
public static SchemaType getTorqueType(Integer sqlType)
sqlType
- the SQL type
public static boolean isBooleanInt(SchemaType type)
type
- The type to check.
public static boolean isBooleanChar(SchemaType type)
type
- The type to check.
public static boolean isBit(SchemaType type)
type
- The type to check.
public static final boolean isTextType(SchemaType type)
type
- The type to check.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |