Class AbstractSql92Backend

    • Field Detail

      • SQL_FOR_UPDATE

        public static final java.lang.String SQL_FOR_UPDATE
        FOR UPDATE string.
        See Also:
        Constant Field Values
      • SQL_COALESCE

        public static final java.lang.String SQL_COALESCE
        COALESCE keyword.
        See Also:
        Constant Field Values
      • RESERVED_WORDS_SQL92

        public static final java.lang.String[] RESERVED_WORDS_SQL92
        array of reserved words.
    • Constructor Detail

      • AbstractSql92Backend

        public AbstractSql92Backend()
    • Method Detail

      • getReservedWords

        public java.util.Set<java.lang.String> getReservedWords()
        Description copied from interface: Backend
        Gets the list of reserved words for this backend.
        Returns:
        the list of reserved words
      • buildSelectSql

        public void buildSelectSql​(java.lang.StringBuilder sqlBuilder,
                                   boolean writeLock,
                                   int limit,
                                   int offset)
        Description copied from interface: Backend
        Creates a select statement string from an inner sql string.

        sqlBuilder is anything as FROM... WHERE... ORDER BY....
        It is decorated with a leading SELECT plus optional clauses like for the given parameters.

        Parameters:
        sqlBuilder - the sql builder, initially containing the inner sql without leading SELECT.
        writeLock - true select should write lock
        limit - the limit value, ≤ 0 if no limit clause
        offset - the offset value, ≤ 0 if no offset clause
      • setLeadingSelectParameters

        public int setLeadingSelectParameters​(BackendPreparedStatement stmt,
                                              int limit,
                                              int offset)
        Description copied from interface: Backend
        Sets optional parameters before applying the original parameters.
        Parameters:
        stmt - the prepared statement
        limit - the limit value, ≤ 0 if no limit clause
        offset - the offset value, ≤ 0 if no offset clause
        Returns:
        the next parameter index
      • setTrailingSelectParameters

        public int setTrailingSelectParameters​(BackendPreparedStatement stmt,
                                               int index,
                                               int limit,
                                               int offset)
        Description copied from interface: Backend
        Sets optional parameters after applying the original parameters.
        Parameters:
        stmt - the prepared statement
        index - the first parameter index
        limit - the limit value, ≤ 0 if no limit clause
        offset - the offset value, ≤ 0 if no offset clause
        Returns:
        the next parameter index
      • sqlCreateForeignKey

        public java.lang.String sqlCreateForeignKey​(java.lang.String referencingTableName,
                                                    java.lang.String referencingColumnName,
                                                    java.lang.String referencedTableName,
                                                    java.lang.String referencedColumnName,
                                                    java.lang.String foreignKeyName,
                                                    boolean composite)
        Description copied from interface: Backend
        Generates the ALTER TABLE statement to add a foreign key constraint.
        Parameters:
        referencingTableName - the referencing foreign table name
        referencingColumnName - the referencing foreign column name
        referencedTableName - the referenced primary table name
        referencedColumnName - the referenced primary column name
        foreignKeyName - the name of the foreign key
        composite - true if referencing table is a component of the referenced table
        Returns:
        the SQL code
      • sqlDropForeignKey

        public java.lang.String sqlDropForeignKey​(java.lang.String referencingTableName,
                                                  java.lang.String foreignKeyName)
        Description copied from interface: Backend
        Generates the sql statement to drop a foreign key constraint.
        Parameters:
        referencingTableName - the referencing foreign table name
        foreignKeyName - the name of the foreign key
        Returns:
        the SQL code
      • supportsSequences

        public boolean supportsSequences()
        Description copied from interface: Backend
        True if backend provides transactionless sequences.
        Returns:
        true if database supports sequences
      • sqlNextFromSequene

        public java.lang.String sqlNextFromSequene​(java.lang.String name)
        Description copied from interface: Backend
        Creates the SQL string to retrieve the next id from a sequence.
        Parameters:
        name - the name of the sequence
        Returns:
        the SQL code