Class Ingres9Dialect

  • All Implemented Interfaces:
    ConversionContext
    Direct Known Subclasses:
    Ingres10Dialect

    public class Ingres9Dialect
    extends IngresDialect
    A SQL dialect for Ingres 9.3 and later versions.

    Changes:

    • Support for the SQL functions current_time, current_timestamp and current_date added
    • Type mapping of Types.TIMESTAMP changed from "timestamp with time zone" to "timestamp(9) with time zone"
    • Improved handling of "SELECT...FOR UPDATE" statements
    • Added support for pooled sequences
    • Added support for SELECT queries with limit and offset
    • Added getIdentitySelectString
    • Modified concatenation operator
    • Constructor Detail

      • Ingres9Dialect

        public Ingres9Dialect()
        Constructs a Ingres9Dialect
    • Method Detail

      • registerDateTimeFunctions

        protected void registerDateTimeFunctions()
        Register functions current_time, current_timestamp, current_date
      • registerDateTimeColumnTypes

        protected void registerDateTimeColumnTypes()
        Register column types date, time, timestamp
      • supportsOuterJoinForUpdate

        public boolean supportsOuterJoinForUpdate()
        Description copied from class: Dialect
        Does this dialect support FOR UPDATE in conjunction with outer joined rows?
        Overrides:
        supportsOuterJoinForUpdate in class Dialect
        Returns:
        True if outer joined rows can be locked via FOR UPDATE.
      • forUpdateOfColumns

        public boolean forUpdateOfColumns()
        Description copied from class: Dialect
        Is FOR UPDATE OF syntax supported?
        Overrides:
        forUpdateOfColumns in class Dialect
        Returns:
        True if the database supports FOR UPDATE OF syntax; false otherwise.
      • getQuerySequencesString

        public java.lang.String getQuerySequencesString()
        Description copied from class: Dialect
        Get the select command used retrieve the names of all sequences.
        Overrides:
        getQuerySequencesString in class IngresDialect
        Returns:
        The select command; or null if sequences are not supported.
        See Also:
        SchemaUpdate
      • supportsCurrentTimestampSelection

        public boolean supportsCurrentTimestampSelection()
        Description copied from class: Dialect
        Does this dialect support a way to retrieve the database's current timestamp value?
        Overrides:
        supportsCurrentTimestampSelection in class Dialect
        Returns:
        True if the current timestamp can be retrieved; false otherwise.
      • getCurrentTimestampSelectString

        public java.lang.String getCurrentTimestampSelectString()
        Description copied from class: Dialect
        Retrieve the command used to retrieve the current timestamp from the database.
        Overrides:
        getCurrentTimestampSelectString in class Dialect
        Returns:
        The command.
      • getCurrentTimestampSQLFunctionName

        public java.lang.String getCurrentTimestampSQLFunctionName()
        Description copied from class: Dialect
        The name of the database-specific SQL function for retrieving the current timestamp.
        Overrides:
        getCurrentTimestampSQLFunctionName in class IngresDialect
        Returns:
        The function name.
      • supportsUnionAll

        public boolean supportsUnionAll()
        Description copied from class: Dialect
        Does this dialect support UNION ALL, which is generally a faster variant of UNION?
        Overrides:
        supportsUnionAll in class Dialect
        Returns:
        True if UNION ALL is supported; false otherwise.
      • doesReadCommittedCauseWritersToBlockReaders

        public boolean doesReadCommittedCauseWritersToBlockReaders()
        Description copied from class: Dialect
        For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?
        Overrides:
        doesReadCommittedCauseWritersToBlockReaders in class Dialect
        Returns:
        True if writers block readers to achieve READ_COMMITTED; false otherwise.
      • doesRepeatableReadCauseReadersToBlockWriters

        public boolean doesRepeatableReadCauseReadersToBlockWriters()
        Description copied from class: Dialect
        For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?
        Overrides:
        doesRepeatableReadCauseReadersToBlockWriters in class Dialect
        Returns:
        True if readers block writers to achieve REPEATABLE_READ; false otherwise.
      • supportsLimitOffset

        public boolean supportsLimitOffset()
        Description copied from class: Dialect
        Does this dialect's LIMIT support (if any) additionally support specifying an offset?
        Overrides:
        supportsLimitOffset in class IngresDialect
        Returns:
        True if the dialect supports an offset within the limit support.
      • supportsVariableLimit

        public boolean supportsVariableLimit()
        Description copied from class: Dialect
        Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?
        Overrides:
        supportsVariableLimit in class IngresDialect
        Returns:
        True if bind variables can be used; false otherwise.
      • useMaxForLimit

        public boolean useMaxForLimit()
        Description copied from class: Dialect
        Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?

        This is easiest understood via an example. Consider you have a table with 20 rows, but you only want to retrieve rows number 11 through 20. Generally, a limit with offset would say that the offset = 11 and the limit = 10 (we only want 10 rows at a time); this is specifying the total number of returned rows. Some dialects require that we instead specify offset = 11 and limit = 20, where 20 is the "last" row we want relative to offset (i.e. total number of rows = 20 - 11 = 9)

        So essentially, is limit relative from offset? Or is limit absolute?

        Overrides:
        useMaxForLimit in class IngresDialect
        Returns:
        True if limit is relative from offset; false otherwise.
      • getLimitString

        public java.lang.String getLimitString​(java.lang.String querySelect,
                                               int offset,
                                               int limit)
        Description copied from class: Dialect
        Given a limit and an offset, apply the limit clause to the query.
        Overrides:
        getLimitString in class IngresDialect
        Parameters:
        querySelect - The query to which to apply the limit.
        offset - The offset of the limit
        limit - The limit of the limit ;)
        Returns:
        The modified query statement with the limit applied.