Class SqliteDialect

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

public class SqliteDialect extends StandardDialect
A dialect for SQLite.
  • 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
    • 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
    • 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
    • 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
    • supportsAliasInDeleteStatement

      public boolean supportsAliasInDeleteStatement()
      Description copied from interface: Dialect
      Determines whether the use of table aliases is supported in the context of a DELETE statement.
       DELETE FROM employee t
       
      Returns:
      true if table aliasing is supported in DELETE statements, false otherwise
    • supportsAliasInUpdateStatement

      public boolean supportsAliasInUpdateStatement()
      Description copied from interface: Dialect
      Determines whether the use of table aliases is supported in the context of an UPDATE statement.
       UPDATE employee t SET t.age = 30
       
      Returns:
      true if table aliasing is supported in UPDATE statements, false otherwise
    • supportsAutoIncrementWhenInsertingMultipleRows

      public boolean supportsAutoIncrementWhenInsertingMultipleRows()
      Description copied from interface: Dialect
      Determines whether this dialect supports auto-increment columns when inserting multiple rows.

      Some databases do not properly handle auto-increment columns in multi-row insert statements, or have limitations on how generated values can be retrieved.

      The default implementation returns true.

      Returns:
      true if this dialect supports auto-increment columns in multi-row inserts, false otherwise
    • supportsParenthesesForSetOperands

      public boolean supportsParenthesesForSetOperands()
      Description copied from interface: Dialect
      Determines whether this dialect requires parentheses around set operation operands.

      Set operations include UNION, INTERSECT, and EXCEPT. Some databases require parentheses around the operands of these operations, especially when they include ORDER BY or LIMIT clauses.

      The default implementation returns true.

      Returns:
      true if this dialect requires parentheses for set operands, false otherwise
    • 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
    • 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
    • getUpsertAssembler

      public UpsertAssembler getUpsertAssembler(UpsertAssemblerContext context)
      Description copied from interface: Dialect
      Returns the UpsertAssembler implementation for the given context.
      Specified by:
      getUpsertAssembler in interface Dialect
      Overrides:
      getUpsertAssembler in class StandardDialect
      Parameters:
      context - the UpsertAssemblerContext object
      Returns:
      the UpsertAssembler object for the given context