Class SQLServerTranslator

java.lang.Object
adql.translator.JDBCTranslator
adql.translator.SQLServerTranslator
All Implemented Interfaces:
ADQLTranslator

public class SQLServerTranslator extends JDBCTranslator
MS SQL Server translator.

Important: This translator works correctly ONLY IF SQLServer_ADQLQueryFactory has been used to create any ADQL query this translator is asked to translate.

TODO Translation of Set operations, TOP/LIMIT, OFFSET, ORDER BY TODO See how case sensitivity is supported by MS SQL Server and modify this translator accordingly. TODO Extend this class for each MS SQL Server extension supporting geometry and particularly translateGeometryFromDB(Object), translateGeometryToDB(Region) and all this other translate(...) functions for the ADQL's geometrical functions. TODO Check MS SQL Server datatypes (see convertTypeFromDB(int, String, String, String[]), convertTypeToDB(DBType)).

Important note 1: Geometrical functions and IN_UNIT are not translated ; the translation returned for them is their ADQL expression.

Important note 2: If new optional features are supported in an extension of this translator, they should be visible in getSupportedFeatures(). To customize this list, you must overwrite initSupportedFeatures() and update in there the attribute supportedFeatures.

Since:
1.4
See Also:
  • Field Details

    • caseSensitivity

      protected byte caseSensitivity

      Indicate the case sensitivity to apply to each SQL identifier (only SCHEMA, TABLE and COLUMN).

      Note: In this implementation, this field is set by the constructor and never modified elsewhere. It would be better to never modify it after the construction in order to keep a certain consistency.

    • supportedFeatures

      protected final FeatureSet supportedFeatures
      List of all optional features supported by this translator.

      Note: This list can be customized by extending this translator and then overwriting initSupportedFeatures().

      Since:
      2.0
  • Constructor Details

    • SQLServerTranslator

      public SQLServerTranslator()
      Builds an SQLServerTranslator which always translates in SQL all identifiers (schema, table and column) in a case sensitive manner ; in other words, schema, table and column names will be surrounded by double quotes in the SQL translation.
    • SQLServerTranslator

      public SQLServerTranslator(boolean allCaseSensitive)
      Builds an SQLServerTranslator which always translates in SQL all identifiers (schema, table and column) in the specified case sensitivity ; in other words, schema, table and column names will all be surrounded or not by double quotes in the SQL translation.
      Parameters:
      allCaseSensitive - true to translate all identifiers in a case sensitive manner (surrounded by double quotes), false for case insensitivity.
    • SQLServerTranslator

      public SQLServerTranslator(boolean catalog, boolean schema, boolean table, boolean column)
      Builds an SQLServerTranslator which will always translate in SQL identifiers with the defined case sensitivity.
      Parameters:
      catalog - true to translate catalog names with double quotes (case sensitive in the DBMS), false otherwise.
      schema - true to translate schema names with double quotes (case sensitive in the DBMS), false otherwise.
      table - true to translate table names with double quotes (case sensitive in the DBMS), false otherwise.
      column - true to translate column names with double quotes (case sensitive in the DBMS), false otherwise.
  • Method Details