Class Mssql2008Dialect

java.lang.Object
org.seasar.doma.jdbc.dialect.StandardDialect
org.seasar.doma.jdbc.dialect.Mssql2008Dialect
All Implemented Interfaces:
Dialect
Direct Known Subclasses:
MssqlDialect

public class Mssql2008Dialect extends StandardDialect
A dialect for Microsoft SQL Server 2008 and below.
  • 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:
    • OPEN_QUOTE

      protected static final char OPEN_QUOTE
      the quotation mark of the start
      See Also:
    • CLOSE_QUOTE

      protected static final char CLOSE_QUOTE
      the quotation mark of the end
      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
    • toForUpdateSqlNode

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

      protected SqlNode toPagingSqlNode(SqlNode sqlNode, long offset, long limit)
      Overrides:
      toPagingSqlNode in class StandardDialect
    • 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
    • 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
    • supportsSelectForUpdate

      public boolean supportsSelectForUpdate(SelectForUpdateType type, boolean withTargets)
      Description copied from interface: Dialect
      Determines whether this dialect supports pessimistic locking with the specified options.

      Pessimistic locking (SELECT FOR UPDATE) prevents other transactions from modifying selected rows. Different database systems support different variations of this feature.

      Specified by:
      supportsSelectForUpdate in interface Dialect
      Overrides:
      supportsSelectForUpdate in class StandardDialect
      Parameters:
      type - the type of pessimistic locking (e.g., standard FOR UPDATE, NOWAIT, WAIT)
      withTargets - true if specific columns are targeted for locking, false for row-level locking
      Returns:
      true if this dialect supports the specified locking options, false otherwise
    • supportsAutoGeneratedKeys

      public boolean supportsAutoGeneratedKeys()
      Description copied from interface: Dialect
      Determines whether this dialect supports retrieving auto-generated keys via Statement.getGeneratedKeys().

      This feature allows retrieving values that were automatically generated during an insert operation, such as identity column values, without executing a separate query.

      Specified by:
      supportsAutoGeneratedKeys in interface Dialect
      Overrides:
      supportsAutoGeneratedKeys in class StandardDialect
      Returns:
      true if this dialect supports retrieving auto-generated keys, false otherwise
    • supportsAliasInDeleteClause

      public boolean supportsAliasInDeleteClause()
      Description copied from interface: Dialect
      Determines whether this object supports alias reference in DELETE clause as follows:
       DELETE t FROM employee t
       
      Returns:
      true, if this object supports it
    • supportsAliasInUpdateClause

      public boolean supportsAliasInUpdateClause()
      Description copied from interface: Dialect
      Determines whether this object supports alias reference in UPDATE clause as follows:
       UPDATE t SET t.age = 30 FROM employee t
       
      Returns:
      true, if this object supports it
    • getScriptBlockDelimiter

      public String getScriptBlockDelimiter()
      Description copied from interface: Dialect
      Returns the delimiter that is used as the end of an SQL block in a script.
      Specified by:
      getScriptBlockDelimiter in interface Dialect
      Overrides:
      getScriptBlockDelimiter in class StandardDialect
      Returns:
      the delimiter
    • applyQuote

      public String applyQuote(String name)
      Description copied from interface: Dialect
      Encloses the name with quotation marks.
      Specified by:
      applyQuote in interface Dialect
      Overrides:
      applyQuote in class StandardDialect
      Parameters:
      name - the name of a database object such as a table, a column, and so on
      Returns:
      the name that is enclosed with quotation marks
    • createScriptBlockContext

      public ScriptBlockContext createScriptBlockContext()
      Description copied from interface: Dialect
      Creates the context object to process an SQL block in a script.
      Specified by:
      createScriptBlockContext in interface Dialect
      Overrides:
      createScriptBlockContext in class StandardDialect
      Returns:
      the context object
    • getCriteriaBuilder

      public CriteriaBuilder getCriteriaBuilder()
      Description copied from interface: Dialect
      Returns the criteria builder for this dialect.

      The criteria builder is used to construct SQL queries using the criteria API, which provides a type-safe way to build queries programmatically. The returned builder will generate SQL that is compatible with the specific database dialect.

      Specified by:
      getCriteriaBuilder in interface Dialect
      Overrides:
      getCriteriaBuilder in class StandardDialect
      Returns:
      the criteria builder for this dialect