Class MicrosoftSqlServerDialect

  • All Implemented Interfaces:
    Dialect

    public class MicrosoftSqlServerDialect
    extends JdbcDialectImpl
    Implementation of Dialect for the Microsoft SQL Server database.
    Since:
    Nov 23, 2008
    Author:
    jhyde
    • Constructor Detail

      • MicrosoftSqlServerDialect

        public MicrosoftSqlServerDialect​(Connection connection)
                                  throws SQLException
        Creates a MicrosoftSqlServerDialect.
        Parameters:
        connection - Connection
        Throws:
        SQLException
    • Method Detail

      • generateInline

        public String generateInline​(List<String> columnNames,
                                     List<String> columnTypes,
                                     List<String[]> valueList)
        Description copied from interface: Dialect
        Generates a SQL statement to represent an inline dataset.

        For example, for Oracle, generates

         SELECT 1 AS FOO, 'a' AS BAR FROM dual
         UNION ALL
         SELECT 2 AS FOO, 'b' AS BAR FROM dual
         

        For ANSI SQL, generates:

         VALUES (1, 'a'), (2, 'b')
         
        Specified by:
        generateInline in interface Dialect
        Overrides:
        generateInline in class JdbcDialectImpl
        Parameters:
        columnNames - List of column names
        columnTypes - List of column types ("String" or "Numeric")
        valueList - List of rows values
        Returns:
        SQL string
      • requiresUnionOrderByOrdinal

        public boolean requiresUnionOrderByOrdinal()
        Description copied from interface: Dialect
        Returns true if this dialect allows only integers in the ORDER BY clause of a UNION (or other set operation) query.

        For example, SELECT x, y + z FROM t
        UNION ALL
        SELECT x, y + z FROM t
        ORDER BY 1, 2
        is allowed but SELECT x, y, z FROM t
        UNION ALL
        SELECT x, y, z FROM t
        ORDER BY x
        is not.

        Teradata is an example of a dialect with this restriction.

        Specified by:
        requiresUnionOrderByOrdinal in interface Dialect
        Overrides:
        requiresUnionOrderByOrdinal in class JdbcDialectImpl
        Returns:
        whether this dialect allows only integers in the ORDER BY clause of a UNION (or other set operation) query