Klasse TypeMap
java.lang.Object
org.apache.torque.templates.typemapping.TypeMap
Various mappings for schema types, e.g. to their corresponding
Java object types, and Java native types.
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
- Version:
- $Id: TypeMap.java 1917023 2024-04-16 10:12:17Z gk $
- Autor:
- Jason van Zyl, Martin Poeschl
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String
A sample java object for BIGINT columns.static final String
A sample java object for BINARY columns.static final String
A sample java object for BIT columns.static final String
A sample java object for BLOB columns.static final String
A sample java object for BOOLEANCHAR columns.static final String
A sample java object for BOOLEANINT columns.static final String
A sample java object for CHAR columns.static final String
A sample java object for CLOB columns.static final String
A sample java object for DATE columns.static final String
A sample java object for DECIMAL columns.static final String
A sample java object for DOUBLE columns.static final String
A sample java object for FLOAT columns.static final String
A sample java object for INTEGER columns.static final String
A sample java object for LONGVARBINARY columns.static final String
A sample java object for LONGVARCHAR columns.static final String
A sample java object for NUMERIC columns.static final String
A sample java object for REAL columns.static final String
A sample java object for SMALLINT columns.static final String
A sample java object for TIME columns.static final String
A sample java object for TIMESTAMP columns.static final String
A sample java object for TINYINT columns.static final String
A sample java object for VARBINARY columns.static final String
A sample java object for VARCHAR columns. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic 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.
-
Felddetails
-
CHAR_OBJECT_TYPE
A sample java object for CHAR columns.- Siehe auch:
-
VARCHAR_OBJECT_TYPE
A sample java object for VARCHAR columns.- Siehe auch:
-
LONGVARCHAR_OBJECT_TYPE
A sample java object for LONGVARCHAR columns.- Siehe auch:
-
CLOB_OBJECT_TYPE
A sample java object for CLOB columns.- Siehe auch:
-
NUMERIC_OBJECT_TYPE
A sample java object for NUMERIC columns.- Siehe auch:
-
DECIMAL_OBJECT_TYPE
A sample java object for DECIMAL columns.- Siehe auch:
-
BIT_OBJECT_TYPE
A sample java object for BIT columns.- Siehe auch:
-
TINYINT_OBJECT_TYPE
A sample java object for TINYINT columns.- Siehe auch:
-
SMALLINT_OBJECT_TYPE
A sample java object for SMALLINT columns.- Siehe auch:
-
INTEGER_OBJECT_TYPE
A sample java object for INTEGER columns.- Siehe auch:
-
BIGINT_OBJECT_TYPE
A sample java object for BIGINT columns.- Siehe auch:
-
REAL_OBJECT_TYPE
A sample java object for REAL columns.- Siehe auch:
-
FLOAT_OBJECT_TYPE
A sample java object for FLOAT columns.- Siehe auch:
-
DOUBLE_OBJECT_TYPE
A sample java object for DOUBLE columns.- Siehe auch:
-
BINARY_OBJECT_TYPE
A sample java object for BINARY columns.- Siehe auch:
-
VARBINARY_OBJECT_TYPE
A sample java object for VARBINARY columns.- Siehe auch:
-
LONGVARBINARY_OBJECT_TYPE
A sample java object for LONGVARBINARY columns.- Siehe auch:
-
BLOB_OBJECT_TYPE
A sample java object for BLOB columns.- Siehe auch:
-
DATE_OBJECT_TYPE
A sample java object for DATE columns.- Siehe auch:
-
TIME_OBJECT_TYPE
A sample java object for TIME columns.- Siehe auch:
-
TIMESTAMP_OBJECT_TYPE
A sample java object for TIMESTAMP columns.- Siehe auch:
-
BOOLEANCHAR_OBJECT_TYPE
A sample java object for BOOLEANCHAR columns.- Siehe auch:
-
BOOLEANINT_OBJECT_TYPE
A sample java object for BOOLEANINT columns.- Siehe auch:
-
-
Methodendetails
-
getJavaObject
Return a Java object which corresponds to the JDBC type provided. Use in MapBuilder generation.- Parameter:
jdbcType
- the JDBC type- Gibt zurück:
- name of the Object
-
getJavaPrimitiveType
Returns the java type which corresponds to the schema type provided. Where possible, primitive types are used.- Parameter:
schemaType
- the schema type.- Gibt zurück:
- name of the native java type
-
getJavaObjectType
Returns the java type which corresponds to the schema type provided. Only Object types are used.- Parameter:
schemaType
- the schema type.- Gibt zurück:
- the corresponding java Type.
-
getResultSetGetter
Returns the result set getter method which corresponds to the Schema type provided.- Parameter:
schemaType
- the schema type- Gibt zurück:
- the result set getter method.
-
isBooleanInt
Returns true if the type is boolean in the java object and a numeric (1 or 0) in the db.- Parameter:
type
- The type to check.- Gibt zurück:
- true if the type is BOOLEANINT
-
isBooleanChar
Returns true if the type is boolean in the java object and a String "Y" or "N" in the db.- Parameter:
type
- The type to check.- Gibt zurück:
- true if the type is BOOLEANCHAR
-
isBit
Returns true if the type is boolean in the java object and a Bit "1" or "0" in the db.- Parameter:
type
- The type to check.- Gibt zurück:
- true if the type is BIT
-
isTextType
Returns true if values for the type need to be quoted.- Parameter:
type
- The type to check.- Gibt zurück:
- true if values for the type need to be quoted.
-