Schnittstelle Platform

Alle bekannten Implementierungsklassen:
PlatformDefaultImpl, PlatformDerbyImpl, PlatformHsqldbImpl, PlatformMssqlImpl, PlatformMysqlImpl, PlatformOracleImpl, PlatformPostgresqlImpl

public interface Platform
Interface for RDBMS platform specific behaviour. Which platform actually is used, is determined here: PlatformFactory.getPlatformFor(String).
Version:
$Id: Platform.java 1917240 2024-04-21 13:22:54Z tv $
Autor:
Martin Poeschl
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    boolean
    Returns whether the "not null part" of the definition of a column should be generated before the "autoincrement part" in a "create table" statement.
     
    Formats the given date as date string which is parseable by the database.
    getNullString(boolean notNull)
     
    Returns a possible SQL suffix for column definitions of certain SQL Types, e.g. for Oracle VARCHAR2 columns, it typically makes sense to use 'XXX CHAR' instead of 'XXX' as size.
    Returns the db specific SQL type for a Torque type.
    Formats the given date as timestamp string which is parseable by the database.
    Formats the given date as time string which is parseable by the database.
    boolean
    hasScale(String sqlType)
    Returns if the RDBMS-specific SQL type has a scale attribute.
    boolean
    hasSize(String sqlType)
    Returns if the RDBMS-specific SQL type has a size attribute.
    boolean
    Returns whether the database has schema support unique constraint for columns with size
    Quotes and escapes a string such that it can be used as literal String value in SQL.
    boolean
    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.
  • Methodendetails

    • getSqlTypeForSchemaType

      SqlType getSqlTypeForSchemaType(SchemaType schemaType)
      Returns the db specific SQL type for a Torque type.
      Parameter:
      schemaType - the Torque type, not null.
      Gibt zurück:
      the db specific SQL type, or null if no SQL type is defined for the given Torque type.
    • getNullString

      String getNullString(boolean notNull)
      Parameter:
      notNull - flag for not null
      Gibt zurück:
      The RDBMS-specific SQL fragment for NULL or NOT NULL.
    • getAutoIncrement

      String getAutoIncrement()
      Gibt zurück:
      The RDBMS-specific SQL fragment for autoincrement.
    • hasSize

      boolean hasSize(String sqlType)
      Returns if the RDBMS-specific SQL type has a size attribute.
      Parameter:
      sqlType - the SQL type
      Gibt zurück:
      true if the type has a size attribute
    • hasScale

      boolean hasScale(String sqlType)
      Returns if the RDBMS-specific SQL type has a scale attribute.
      Parameter:
      sqlType - the SQL type
      Gibt zurück:
      true if the type has a scale attribute
    • getSizeSuffix

      String getSizeSuffix(String sqlType)
      Returns a possible SQL suffix for column definitions of certain SQL Types, e.g. for Oracle VARCHAR2 columns, it typically makes sense to use 'XXX CHAR' instead of 'XXX' as size.
      Parameter:
      sqlType - the SQL type to determine the suffix for.
      Gibt zurück:
      the size suffix, not null, may be empty.
    • createNotNullBeforeAutoincrement

      boolean createNotNullBeforeAutoincrement()
      Returns whether the "not null part" of the definition of a column should be generated before the "autoincrement part" in a "create table" statement.
      Gibt zurück:
      true if the "not null part" should be first, false if the "autoincrement part" should be first in a "create table" statement.
    • quoteAndEscape

      String quoteAndEscape(String value)
      Quotes and escapes a string such that it can be used as literal String value in SQL.
      Parameter:
      value - The string to escape, or null.
      Gibt zurück:
      the escaped String, not null.
    • getDateString

      String getDateString(Date date)
      Formats the given date as date string which is parseable by the database.
      Parameter:
      date - the date to format.
      Gibt zurück:
      the date string, inclusive string escaping.
    • getTimeString

      String getTimeString(Date date)
      Formats the given date as time string which is parseable by the database.
      Parameter:
      date - the date to format.
      Gibt zurück:
      the time string, inclusive string escaping.
    • getTimestampString

      String getTimestampString(Date date)
      Formats the given date as timestamp string which is parseable by the database.
      Parameter:
      date - the date to format.
      Gibt zurück:
      the timestamp string, inclusive string escaping.
    • usesStandaloneSchema

      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.
      Gibt zurück:
      true if separate schema creation is possible, false if not.
    • hasUniqueConstraintSize

      boolean hasUniqueConstraintSize()
      Returns whether the database has schema support unique constraint for columns with size
      Gibt zurück:
      true if unique column constraint has size