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 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(adql.db.STCS.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: Geometrical functions are not translated ; the translation returned for them is their ADQL expression.

Since:
1.4
Version:
1.5 (03/2019)
Author:
Grégory Mantelet (ARI;CDS)
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.

  • 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