Package org.apache.torque.templates.typemapping

# Klasse TypeMap

java.lang.Object
org.apache.torque.templates.typemapping.TypeMap

public final class TypeMap extends Object
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

  Felder
  Modifizierer und Typ
  Feld
  Beschreibung
  `static final String`
  `BIGINT_OBJECT_TYPE`
  A sample java object for BIGINT columns.
  `static final String`
  `BINARY_OBJECT_TYPE`
  A sample java object for BINARY columns.
  `static final String`
  `BIT_OBJECT_TYPE`
  A sample java object for BIT columns.
  `static final String`
  `BLOB_OBJECT_TYPE`
  A sample java object for BLOB columns.
  `static final String`
  `BOOLEANCHAR_OBJECT_TYPE`
  A sample java object for BOOLEANCHAR columns.
  `static final String`
  `BOOLEANINT_OBJECT_TYPE`
  A sample java object for BOOLEANINT columns.
  `static final String`
  `CHAR_OBJECT_TYPE`
  A sample java object for CHAR columns.
  `static final String`
  `CLOB_OBJECT_TYPE`
  A sample java object for CLOB columns.
  `static final String`
  `DATE_OBJECT_TYPE`
  A sample java object for DATE columns.
  `static final String`
  `DECIMAL_OBJECT_TYPE`
  A sample java object for DECIMAL columns.
  `static final String`
  `DOUBLE_OBJECT_TYPE`
  A sample java object for DOUBLE columns.
  `static final String`
  `FLOAT_OBJECT_TYPE`
  A sample java object for FLOAT columns.
  `static final String`
  `INTEGER_OBJECT_TYPE`
  A sample java object for INTEGER columns.
  `static final String`
  `LONGVARBINARY_OBJECT_TYPE`
  A sample java object for LONGVARBINARY columns.
  `static final String`
  `LONGVARCHAR_OBJECT_TYPE`
  A sample java object for LONGVARCHAR columns.
  `static final String`
  `NUMERIC_OBJECT_TYPE`
  A sample java object for NUMERIC columns.
  `static final String`
  `REAL_OBJECT_TYPE`
  A sample java object for REAL columns.
  `static final String`
  `SMALLINT_OBJECT_TYPE`
  A sample java object for SMALLINT columns.
  `static final String`
  `TIME_OBJECT_TYPE`
  A sample java object for TIME columns.
  `static final String`
  `TIMESTAMP_OBJECT_TYPE`
  A sample java object for TIMESTAMP columns.
  `static final String`
  `TINYINT_OBJECT_TYPE`
  A sample java object for TINYINT columns.
  `static final String`
  `VARBINARY_OBJECT_TYPE`
  A sample java object for VARBINARY columns.
  `static final String`
  `VARCHAR_OBJECT_TYPE`
  A sample java object for VARCHAR columns.

- ## Methodenübersicht

  Modifizierer und Typ
  Methode
  Beschreibung
  `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.

  ### Von Klasse geerbte Methoden java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Felddetails

  - ### CHAR_OBJECT_TYPE

    public static final String CHAR_OBJECT_TYPE
    A sample java object for CHAR columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### VARCHAR_OBJECT_TYPE

    public static final String VARCHAR_OBJECT_TYPE
    A sample java object for VARCHAR columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### LONGVARCHAR_OBJECT_TYPE

    public static final String LONGVARCHAR_OBJECT_TYPE
    A sample java object for LONGVARCHAR columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### CLOB_OBJECT_TYPE

    public static final String CLOB_OBJECT_TYPE
    A sample java object for CLOB columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### NUMERIC_OBJECT_TYPE

    public static final String NUMERIC_OBJECT_TYPE
    A sample java object for NUMERIC columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### DECIMAL_OBJECT_TYPE

    public static final String DECIMAL_OBJECT_TYPE
    A sample java object for DECIMAL columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### BIT_OBJECT_TYPE

    public static final String BIT_OBJECT_TYPE
    A sample java object for BIT columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### TINYINT_OBJECT_TYPE

    public static final String TINYINT_OBJECT_TYPE
    A sample java object for TINYINT columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### SMALLINT_OBJECT_TYPE

    public static final String SMALLINT_OBJECT_TYPE
    A sample java object for SMALLINT columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### INTEGER_OBJECT_TYPE

    public static final String INTEGER_OBJECT_TYPE
    A sample java object for INTEGER columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### BIGINT_OBJECT_TYPE

    public static final String BIGINT_OBJECT_TYPE
    A sample java object for BIGINT columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### REAL_OBJECT_TYPE

    public static final String REAL_OBJECT_TYPE
    A sample java object for REAL columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### FLOAT_OBJECT_TYPE

    public static final String FLOAT_OBJECT_TYPE
    A sample java object for FLOAT columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### DOUBLE_OBJECT_TYPE

    public static final String DOUBLE_OBJECT_TYPE
    A sample java object for DOUBLE columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### BINARY_OBJECT_TYPE

    public static final String BINARY_OBJECT_TYPE
    A sample java object for BINARY columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### VARBINARY_OBJECT_TYPE

    public static final String VARBINARY_OBJECT_TYPE
    A sample java object for VARBINARY columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### LONGVARBINARY_OBJECT_TYPE

    public static final String LONGVARBINARY_OBJECT_TYPE
    A sample java object for LONGVARBINARY columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### BLOB_OBJECT_TYPE

    public static final String BLOB_OBJECT_TYPE
    A sample java object for BLOB columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### DATE_OBJECT_TYPE

    public static final String DATE_OBJECT_TYPE
    A sample java object for DATE columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### TIME_OBJECT_TYPE

    public static final String TIME_OBJECT_TYPE
    A sample java object for TIME columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### TIMESTAMP_OBJECT_TYPE

    public static final String TIMESTAMP_OBJECT_TYPE
    A sample java object for TIMESTAMP columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### BOOLEANCHAR_OBJECT_TYPE

    public static final String BOOLEANCHAR_OBJECT_TYPE
    A sample java object for BOOLEANCHAR columns.
    Siehe auch:
      - Konstantenfeldwerte

  - ### BOOLEANINT_OBJECT_TYPE

    public static final String BOOLEANINT_OBJECT_TYPE
    A sample java object for BOOLEANINT columns.
    Siehe auch:
      - Konstantenfeldwerte

- ## Methodendetails

  - ### getJavaObject

    public static String getJavaObject(SchemaType jdbcType)
    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

    public static JavaType getJavaPrimitiveType(SchemaType schemaType)
    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

    public static JavaType getJavaObjectType(SchemaType schemaType)
    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

    public static ResultSetGetter getResultSetGetter(SchemaType schemaType)
    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

    public 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.
    Parameter:
      `type` - The type to check.
    Gibt zurück:
      true if the type is BOOLEANINT

  - ### isBooleanChar

    public 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.
    Parameter:
      `type` - The type to check.
    Gibt zurück:
      true if the type is BOOLEANCHAR

  - ### isBit

    public 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.
    Parameter:
      `type` - The type to check.
    Gibt zurück:
      true if the type is BIT

  - ### isTextType

    public static boolean isTextType(SchemaType type)
    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.