Package org.apache.torque.templates.platform

# Class PlatformMysqlImpl

java.lang.Object
org.apache.torque.templates.platform.PlatformDefaultImpl
org.apache.torque.templates.platform.PlatformMysqlImpl

All Implemented Interfaces:
  `Platform`

public class PlatformMysqlImpl extends PlatformDefaultImpl
MySql Platform implementation.

Version:
  $Id: PlatformMysqlImpl.java 1917240 2024-04-21 13:22:54Z tv $
Author:
  Martin Poeschl

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PlatformMysqlImpl()`
  Default constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `escapeBackslashes()`
  Returns whether backslashes must be escaped in string literals.
  `String`
  `getAutoIncrement()`
  `String`
  `getDateString(Date date)`
  Formats the given date as date string which is parseable by the database.
  `String`
  `getTimestampString(Date date)`
  Formats the given date as timestamp string which is parseable by the database.
  `boolean`
  `hasScale(String sqlType)`
  precison in time formats is more like a scale, which is the number of digits to the right of the decimal point in a number.
  `boolean`
  `hasSize(String sqlType)`
  Returns if the RDBMS-specific SQL type has a size attribute.
  `boolean`
  `hasUniqueConstraintSize()`
  Returns whether the database has schema support unique constraint for columns with size

  ### Methods inherited from class org.apache.torque.templates.platform.PlatformDefaultImpl

  `createNotNullBeforeAutoincrement, formatDateTimeString, getNullString, getSizeSuffix, getSqlTypeForSchemaType, getTimeString, quoteAndEscape, setSchemaTypeToSqlTypeMapping, usesStandaloneSchema`

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### PlatformMysqlImpl

    public PlatformMysqlImpl()
    Default constructor.

- ## Method Details

  - ### getAutoIncrement

    public String getAutoIncrement()
    Specified by:
      `getAutoIncrement` in interface `Platform`
    Overrides:
      `getAutoIncrement` in class `PlatformDefaultImpl`
    Returns:
      The RDBMS-specific SQL fragment for autoincrement.
    See Also:
      - `Platform.getAutoIncrement()`

  - ### hasSize

    public boolean hasSize(String sqlType)
    Description copied from interface: `Platform`
    Returns if the RDBMS-specific SQL type has a size attribute.
    Specified by:
      `hasSize` in interface `Platform`
    Overrides:
      `hasSize` in class `PlatformDefaultImpl`
    Parameters:
      `sqlType` - the SQL type
    Returns:
      true if the type has a size attribute
    See Also:
      - `Platform.hasSize(String)`

  - ### hasScale

    public boolean hasScale(String sqlType)
    precison in time formats is more like a scale, which is the number of digits to the right of the decimal point in a number.
    Specified by:
      `hasScale` in interface `Platform`
    Overrides:
      `hasScale` in class `PlatformDefaultImpl`
    Parameters:
      `sqlType` - the SQL type
    Returns:
      true if the type has a scale attribute
    See Also:
      - `Platform.hasScale(String)`

  - ### escapeBackslashes

    protected boolean escapeBackslashes()
    Description copied from class: `PlatformDefaultImpl`
    Returns whether backslashes must be escaped in string literals.
    Overrides:
      `escapeBackslashes` in class `PlatformDefaultImpl`
    Returns:
      true if backslashes bust be escaped, false otherwise.

  - ### getDateString

    public String getDateString(Date date)
    Formats the given date as date string which is parseable by the database.
    Specified by:
      `getDateString` in interface `Platform`
    Overrides:
      `getDateString` in class `PlatformDefaultImpl`
    Parameters:
      `date` - the date to format.
    Returns:
      the date string, inclusive string escaping.

  - ### getTimestampString

    public String getTimestampString(Date date)
    Formats the given date as timestamp string which is parseable by the database.
    Specified by:
      `getTimestampString` in interface `Platform`
    Overrides:
      `getTimestampString` in class `PlatformDefaultImpl`
    Parameters:
      `date` - the date to format.
    Returns:
      the timestamp string, inclusive string escaping.

  - ### hasUniqueConstraintSize

    public boolean hasUniqueConstraintSize()
    Returns whether the database has schema support unique constraint for columns with size
    Specified by:
      `hasUniqueConstraintSize` in interface `Platform`
    Overrides:
      `hasUniqueConstraintSize` in class `PlatformDefaultImpl`
    Returns:
      true if unique column constraint has size