Package org.apache.torque.templates.platform

# Class PlatformMssqlImpl

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

All Implemented Interfaces:
  `Platform`

public class PlatformMssqlImpl extends PlatformDefaultImpl
MS SQL Platform implementation.

Version:
  $Id: PlatformMssqlImpl.java 1917240 2024-04-21 13:22:54Z tv $
Author:
  Martin Poeschl, Greg Monroe

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PlatformMssqlImpl()`
  Default constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `escapeBackslashes()`
  Returns whether backslashes must be escaped in string literals.
  `String`
  `getNullString(boolean notNull)`
  `String`
  `getTimestampString(Date date)`
  Formats the given date as timestamp string which is parseable by the database.
  `boolean`
  `hasSize(String sqlType)`
  Returns if the RDBMS-specific SQL type has a size attribute.
  `boolean`
  `usesStandaloneSchema()`
  Returns whether the database has schema support where a schema is not tied to a user (oracle) or database (mysql), but can be created separately.

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

  `createNotNullBeforeAutoincrement, formatDateTimeString, getAutoIncrement, getDateString, getSizeSuffix, getSqlTypeForSchemaType, getTimeString, hasScale, hasUniqueConstraintSize, quoteAndEscape, setSchemaTypeToSqlTypeMapping`

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

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

- ## Constructor Details

  - ### PlatformMssqlImpl

    public PlatformMssqlImpl()
    Default constructor.

- ## Method Details

  - ### getNullString

    public String getNullString(boolean notNull)
    Specified by:
      `getNullString` in interface `Platform`
    Overrides:
      `getNullString` in class `PlatformDefaultImpl`
    Parameters:
      `notNull` - flag for not null
    Returns:
      Explicitly returns `NULL` if null values are allowed (as recomended by Microsoft).
    See Also:
      - `Platform.getNullString(boolean)`

  - ### 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.

  - ### 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.

  - ### usesStandaloneSchema

    public boolean usesStandaloneSchema()
    Returns whether the database has schema support where a schema is not tied to a user (oracle) or database (mysql), but can be created separately.
    Specified by:
      `usesStandaloneSchema` in interface `Platform`
    Overrides:
      `usesStandaloneSchema` in class `PlatformDefaultImpl`
    Returns:
      this implementation returns true.

  - ### 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)`