Class Ingres9Dialect

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 concatination operator
  • Constructor Details

    • Ingres9Dialect

      public Ingres9Dialect()
  • Method Details

    • 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()
      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()
      Is FOR UPDATE OF syntax supported?
      Overrides:
      forUpdateOfColumns in class Dialect
      Returns:
      True if the database supports FOR UPDATE OF syntax; false otherwise.
    • getIdentitySelectString

      public String getIdentitySelectString()
      Get the select command used to retrieve the last generated sequence value.
      Overrides:
      getIdentitySelectString in class Dialect
      Returns:
      Statement to retrieve last generated sequence value
    • getQuerySequencesString

      public String getQuerySequencesString()
      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:
    • supportsPooledSequences

      public boolean supportsPooledSequences()
      Does this dialect support "pooled" sequences. Not aware of a better name for this. Essentially can we specify the initial and increment values?
      Overrides:
      supportsPooledSequences in class Dialect
      Returns:
      True if such "pooled" sequences are supported; false otherwise.
      See Also:
    • isCurrentTimestampSelectStringCallable

      public boolean isCurrentTimestampSelectStringCallable()
      Should the value returned by getCurrentTimestampSelectString() be treated as callable. Typically this indicates that JDBC escape sytnax is being used...
      Overrides:
      isCurrentTimestampSelectStringCallable in class Dialect
      Returns:
      True if the getCurrentTimestampSelectString() return is callable; false otherwise.
    • supportsCurrentTimestampSelection

      public boolean supportsCurrentTimestampSelection()
      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 String getCurrentTimestampSelectString()
      Retrieve the command used to retrieve the current timestammp from the database.
      Overrides:
      getCurrentTimestampSelectString in class Dialect
      Returns:
      The command.
    • getCurrentTimestampSQLFunctionName

      public String getCurrentTimestampSQLFunctionName()
      Expression for current_timestamp
      Overrides:
      getCurrentTimestampSQLFunctionName in class IngresDialect
      Returns:
      The function name.
    • supportsUnionAll

      public boolean supportsUnionAll()
      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()
      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
    • doesRepeatableReadCauseReadersToBlockWriters

      public boolean doesRepeatableReadCauseReadersToBlockWriters()
      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
    • supportsLimitOffset

      public boolean supportsLimitOffset()
      Does this dialect's LIMIT support (if any) additionally support specifying an offset?
      Overrides:
      supportsLimitOffset in class IngresDialect
      Returns:
      true
    • supportsVariableLimit

      public boolean supportsVariableLimit()
      Does this dialect support bind variables (i.e., prepared statememnt parameters) for its limit/offset?
      Overrides:
      supportsVariableLimit in class IngresDialect
      Returns:
      false
    • useMaxForLimit

      public boolean useMaxForLimit()
      Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?
      Overrides:
      useMaxForLimit in class IngresDialect
      Returns:
      True if limit is relative from offset; false otherwise.
    • getLimitString

      public String getLimitString(String querySelect, int offset, int limit)
      Add a LIMIT clause to the given SQL SELECT
      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 SQL