Package org.apache.torque.templates.typemapping

# Klasse SizedForBitDataSqlType

java.lang.Object
org.apache.torque.templates.typemapping.SqlType
org.apache.torque.templates.typemapping.SizedForBitDataSqlType

public class SizedForBitDataSqlType extends SqlType

Supports the Derby / DB2 / SQL92 standard for defining Binary data fields with either CHAR(#) FOR BIT DATA or VARCHAR(#) FOR BIT DATA. This can be used in Platform implementors initialize() methods, by using lines like:

`setSchemaTypeToSqlTypeMapping( SchemaType.VARBINARY, new SizedForBitDataSqlType("VARCHAR", "32672"));`

This will cause the Column.getSqlString() method to produce items similar to:

`CHAR(#) FOR BIT DATA VARCHAR(#) FOR BIT DATA`

Where: # is the size= schema attribute or a default size specified in the constructor.

Note that this is dependent on the platform implementation correctly defining BINARY and VARBINARY as having a size attribute in the "hasSize()" method.

Autor:
  Greg Monroe
Siehe auch:
  - `Platform`

- ## Konstruktorübersicht

  Konstruktoren
  Konstruktor
  Beschreibung
  `SizedForBitDataSqlType(String sqlType)`
  `SizedForBitDataSqlType(String sqlType, String size)`
  `SizedForBitDataSqlType(SqlType sqlType, String size, String scale, String defaultValue)`

- ## Methodenübersicht

  Modifizierer und Typ
  Methode
  Beschreibung
  `SqlType`
  `getNew(String size, String scale, String defaultValue)`
  Returns a new instance with the given sqlTypeName, size, scale and default value.
  `String`
  `printSize(String sizeSuffix)`
  Return the size and scale in brackets for use in an SQL script.

  ### Von Klasse geerbte Methoden org.apache.torque.templates.typemapping.SqlType

  `getDefaultValue, getScale, getSize, getSqlTypeName, printScale`

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

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

- ## Konstruktordetails

  - ### SizedForBitDataSqlType

    public SizedForBitDataSqlType(String sqlType)
    Parameter:
      `sqlType` - the sql type

  - ### SizedForBitDataSqlType

    public SizedForBitDataSqlType(String sqlType, String size)
    Parameter:
      `sqlType` - the sql type
      `size` - size

  - ### SizedForBitDataSqlType

    public SizedForBitDataSqlType(SqlType sqlType, String size, String scale, String defaultValue)
    Parameter:
      `sqlType` - the sql type
      `size` - of the data
      `scale` - of the data
      `defaultValue` - for the data

- ## Methodendetails

  - ### printSize

    public String printSize(String sizeSuffix)
    Beschreibung aus Klasse kopiert: `SqlType`
    Return the size and scale in brackets for use in an SQL script.
    Setzt außer Kraft:
      `printSize` in Klasse `SqlType`
    Gibt zurück:
      "(size) FOR BIT DATA" or just " FOR BIT DATA" if size is null.
    Siehe auch:
      - `Returns the size postfix for the base SQL Column type.`

  - ### getNew

    public SqlType getNew(String size, String scale, String defaultValue)
    Beschreibung aus Klasse kopiert: `SqlType`
    Returns a new instance with the given sqlTypeName, size, scale and default value.
    Setzt außer Kraft:
      `getNew` in Klasse `SqlType`
    Parameter:
      `size` - of the sql
      `scale` - of the sql
      `defaultValue` - to be provided
    Gibt zurück:
      a new instance with the given parameters.