public final class TypeMap extends Object
------------------------------------------------------- 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
Modifier and Type | Field and Description |
---|---|
static String |
BIGINT_OBJECT_TYPE
A sample java object for BIGINT columns.
|
static String |
BINARY_OBJECT_TYPE
A sample java object for BINARY columns.
|
static String |
BIT_OBJECT_TYPE
A sample java object for BIT columns.
|
static String |
BLOB_OBJECT_TYPE
A sample java object for BLOB columns.
|
static String |
BOOLEANCHAR_OBJECT_TYPE
A sample java object for BOOLEANCHAR columns.
|
static String |
BOOLEANINT_OBJECT_TYPE
A sample java object for BOOLEANINT columns.
|
static String |
CHAR_OBJECT_TYPE
A sample java object for CHAR columns.
|
static String |
CLOB_OBJECT_TYPE
A sample java object for CLOB columns.
|
static String |
DATE_OBJECT_TYPE
A sample java object for DATE columns.
|
static String |
DECIMAL_OBJECT_TYPE
A sample java object for DECIMAL columns.
|
static String |
DOUBLE_OBJECT_TYPE
A sample java object for DOUBLE columns.
|
static String |
FLOAT_OBJECT_TYPE
A sample java object for FLOAT columns.
|
static String |
INTEGER_OBJECT_TYPE
A sample java object for INTEGER columns.
|
static String |
LONGVARBINARY_OBJECT_TYPE
A sample java object for LONGVARBINARY columns.
|
static String |
LONGVARCHAR_OBJECT_TYPE
A sample java object for LONGVARCHAR columns.
|
static String |
NUMERIC_OBJECT_TYPE
A sample java object for NUMERIC columns.
|
static String |
REAL_OBJECT_TYPE
A sample java object for REAL columns.
|
static String |
SMALLINT_OBJECT_TYPE
A sample java object for SMALLINT columns.
|
static String |
TIME_OBJECT_TYPE
A sample java object for TIME columns.
|
static String |
TIMESTAMP_OBJECT_TYPE
A sample java object for TIMESTAMP columns.
|
static String |
TINYINT_OBJECT_TYPE
A sample java object for TINYINT columns.
|
static String |
VARBINARY_OBJECT_TYPE
A sample java object for VARBINARY columns.
|
static String |
VARCHAR_OBJECT_TYPE
A sample java object for VARCHAR columns.
|
Modifier and Type | Method and Description |
---|---|
static String |
getJavaObject(SchemaType jdbcType)
Return a Java object which corresponds to the
JDBC type provided.
|
static JavaType |
getJavaObjectType(SchemaType schemaType)
Returns the java type which corresponds to the schema type provided.
|
static JavaType |
getJavaPrimitiveType(SchemaType schemaType)
Returns the java type which corresponds to the schema type provided.
|
static ResultSetGetter |
getResultSetGetter(SchemaType schemaType)
Returns the result set getter method which corresponds to the
Schema type provided.
|
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 |
isTextType(SchemaType type)
Returns true if values for the type need to be quoted.
|
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 String getJavaObject(SchemaType jdbcType)
jdbcType
- the JDBC typepublic static JavaType getJavaPrimitiveType(SchemaType schemaType)
schemaType
- the schema type.public static JavaType getJavaObjectType(SchemaType schemaType)
schemaType
- the schema type.public static ResultSetGetter getResultSetGetter(SchemaType schemaType)
schemaType
- the schema typepublic 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 boolean isTextType(SchemaType type)
type
- The type to check.Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.