Class Oracle11Dialect

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

public class Oracle11Dialect extends StandardDialect
A dialect for Oracle Database 11g 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:
    • RESULT_SET

      protected static final JdbcType<ResultSet> RESULT_SET
      the JDBC type for ResultSet
  • 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
    • supportsBatchUpdateResults

      public boolean supportsBatchUpdateResults()
      Description copied from interface: Dialect
      Determines whether this dialect supports reliable results from Statement.executeBatch().

      Some database systems do not correctly report the number of affected rows for each statement in a batch operation. This method indicates whether the dialect can rely on these results.

      Specified by:
      supportsBatchUpdateResults in interface Dialect
      Overrides:
      supportsBatchUpdateResults in class StandardDialect
      Returns:
      true if this dialect supports reliable batch update results, false otherwise
    • 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
    • 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)
    • 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
    • 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
    • supportsResultSetReturningAsOutParameter

      public boolean supportsResultSetReturningAsOutParameter()
      Description copied from interface: Dialect
      Determines whether this dialect supports result sets as OUT parameters in stored procedures.

      Some database systems allow stored procedures to return result sets through OUT parameters, while others use different mechanisms (like returning result sets directly).

      Specified by:
      supportsResultSetReturningAsOutParameter in interface Dialect
      Overrides:
      supportsResultSetReturningAsOutParameter in class StandardDialect
      Returns:
      true if this dialect supports result sets as OUT parameters, false otherwise
    • supportsModOperator

      public boolean supportsModOperator()
      Description copied from interface: Dialect
      Determines whether this object supports mod operator %.
      Returns:
      true, if this object supports it
    • supportsMultiRowInsertStatement

      public boolean supportsMultiRowInsertStatement()
      Description copied from interface: Dialect
      Determines whether this dialect supports multi-row insert statements (bulk inserts).

      Multi-row insert statements allow inserting multiple rows in a single SQL statement, which can significantly improve performance when inserting large amounts of data.

      The default implementation returns true.

      Returns:
      true if this dialect supports multi-row insert 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
    • getResultSetType

      public JdbcType<ResultSet> getResultSetType()
      Description copied from interface: Dialect
      Returns the JdbcType object that corresponds to the ResultSet class.

      This method is available, only if Dialect.supportsResultSetReturningAsOutParameter() is true.

      Specified by:
      getResultSetType in interface Dialect
      Overrides:
      getResultSetType in class StandardDialect
      Returns:
      the JdbcType object for the ResultSet class
    • 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
    • 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