Class FirebirdDialect

  • All Implemented Interfaces:
    Dialect

    public class FirebirdDialect
    extends JdbcDialectImpl
    Implementation of Dialect for the Firebird database.
    Since:
    Nov 23, 2008
    Author:
    jhyde
    • Constructor Detail

      • FirebirdDialect

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

      • allowsAs

        public boolean allowsAs()
        Description copied from interface: Dialect
        Returns whether the SQL dialect allows "AS" in the FROM clause. If so, "SELECT * FROM t AS alias" is a valid query.
        Specified by:
        allowsAs in interface Dialect
        Overrides:
        allowsAs in class JdbcDialectImpl
        Returns:
        whether dialect allows AS in FROM clause
      • generateOrderByNulls

        public String generateOrderByNulls​(String expr,
                                           boolean ascending,
                                           boolean collateNullsLast)
        Description copied from class: JdbcDialectImpl
        Generates SQL to force null values to collate last.

        This default implementation makes use of the ANSI SQL 1999 CASE-WHEN-THEN-ELSE in conjunction with IS NULL syntax. The resulting SQL will look something like this:

        CASE WHEN "expr" IS NULL THEN 0 ELSE 1 END

        You can override this method for a particular database to use something more efficient, like ISNULL().

        ANSI SQL provides the syntax "ASC/DESC NULLS LAST" and "ASC/DESC NULLS FIRST". If your database supports the ANSI syntax, implement this method by calling JdbcDialectImpl.generateOrderByNullsAnsi(java.lang.String, boolean, boolean).

        This method is only called from JdbcDialectImpl.generateOrderItem(String, boolean, boolean, boolean). Some dialects override that method and therefore never call this method.

        Overrides:
        generateOrderByNulls in class JdbcDialectImpl
        Parameters:
        expr - Expression.
        ascending - Whether ascending.
        collateNullsLast - Whether nulls should appear first or last.
        Returns:
        Expression to force null values to collate last or first.