Class HsqldbDialect

java.lang.Object
org.seasar.doma.jdbc.dialect.StandardDialect
org.seasar.doma.jdbc.dialect.HsqldbDialect
All Implemented Interfaces:
Dialect

public class HsqldbDialect extends StandardDialect
A dialect for HSQLDB.
  • Field Details

    • UNIQUE_CONSTRAINT_VIOLATION_ERROR_CODE

      protected static final int UNIQUE_CONSTRAINT_VIOLATION_ERROR_CODE
      the error code that represents unique violation
      See Also:
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from interface: Dialect
      Returns the name of this dialect.

      The dialect name typically identifies the database system that this dialect supports. This name can be used for logging, debugging, or to make decisions based on the specific database being used.

      Each dialect implementation should return a unique and descriptive name.

      Specified by:
      getName in interface Dialect
      Overrides:
      getName in class StandardDialect
      Returns:
      the name of this dialect
    • includesIdentityColumn

      public boolean includesIdentityColumn()
      Description copied from interface: Dialect
      Determines whether this dialect includes IDENTITY columns in SQL INSERT statements.

      Some database systems require that IDENTITY columns be excluded from INSERT statements, while others allow or require them to be included.

      Specified by:
      includesIdentityColumn in interface Dialect
      Overrides:
      includesIdentityColumn in class StandardDialect
      Returns:
      true if this dialect includes IDENTITY columns in INSERT statements, false otherwise
    • getIdentitySelectSql

      public PreparedSql getIdentitySelectSql(String catalogName, String schemaName, String tableName, String columnName, boolean isQuoteRequired, boolean isIdColumnQuoteRequired)
      Description copied from interface: Dialect
      Returns an SQL object to retrieve IDENTITY values that were generated during an insert operation.

      This method is used to create the SQL statement that retrieves the last generated identity value for a specific table and column.

      This method is available only if Dialect.supportsIdentity() returns true.

      Specified by:
      getIdentitySelectSql in interface Dialect
      Overrides:
      getIdentitySelectSql in class StandardDialect
      Parameters:
      catalogName - the catalog name of the table (may be null if not applicable)
      schemaName - the schema name of the table (may be null if not applicable)
      tableName - the name of the table containing the identity column
      columnName - the name of the identity column
      isQuoteRequired - whether the table name should be quoted in the SQL statement
      isIdColumnQuoteRequired - whether the identity column name should be quoted in the SQL statement
      Returns:
      the SQL object that can be executed to retrieve the generated identity value
    • getSequenceNextValSql

      public PreparedSql getSequenceNextValSql(String qualifiedSequenceName, long allocationSize)
      Description copied from interface: Dialect
      Returns an SQL object to retrieve the next value from a database sequence.

      This method creates the SQL statement needed to get the next value from a sequence.

      The allocation size parameter can be used to optimize sequence access by retrieving multiple values at once in database systems that support this feature.

      This method is available only if Dialect.supportsSequence() returns true.

      Specified by:
      getSequenceNextValSql in interface Dialect
      Overrides:
      getSequenceNextValSql in class StandardDialect
      Parameters:
      qualifiedSequenceName - the fully qualified name of the sequence, which may include catalog and schema information depending on the database system
      allocationSize - the number of sequence values to allocate at once for optimization; a value greater than 1 may improve performance by reducing database calls
      Returns:
      the SQL object that can be executed to retrieve the next sequence value(s)
    • isUniqueConstraintViolated

      public boolean isUniqueConstraintViolated(SQLException sqlException)
      Description copied from interface: Dialect
      Determines whether the given SQLException represents a unique constraint violation.

      Different database systems use different error codes and states to indicate unique constraint violations. This method abstracts these differences.

      Specified by:
      isUniqueConstraintViolated in interface Dialect
      Overrides:
      isUniqueConstraintViolated in class StandardDialect
      Parameters:
      sqlException - the SQL exception to analyze
      Returns:
      true if the exception represents a unique constraint violation, false otherwise
    • toPagingSqlNode

      protected SqlNode toPagingSqlNode(SqlNode sqlNode, long offset, long limit)
      Overrides:
      toPagingSqlNode in class StandardDialect
    • toForUpdateSqlNode

      protected SqlNode toForUpdateSqlNode(SqlNode sqlNode, SelectForUpdateType forUpdateType, int waitSeconds, String... aliases)
      Overrides:
      toForUpdateSqlNode in class StandardDialect
    • supportsIdentity

      public boolean supportsIdentity()
      Description copied from interface: Dialect
      Determines whether this dialect supports the IDENTITY column.

      An IDENTITY column is a column that automatically generates a unique value for each row when data is inserted. The exact implementation varies by database system.

      Specified by:
      supportsIdentity in interface Dialect
      Overrides:
      supportsIdentity in class StandardDialect
      Returns:
      true if this dialect supports IDENTITY columns, false otherwise
    • supportsSequence

      public boolean supportsSequence()
      Description copied from interface: Dialect
      Determines whether this dialect supports database sequences.

      A sequence is a database object that generates a sequence of unique numbers. Sequences are commonly used to generate primary key values.

      Specified by:
      supportsSequence in interface Dialect
      Overrides:
      supportsSequence in class StandardDialect
      Returns:
      true if this dialect supports sequences, false otherwise