- All Implemented Interfaces:
Dialect
- Direct Known Subclasses:
OracleDialect
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classNested classes/interfaces inherited from class org.seasar.doma.jdbc.dialect.StandardDialect
StandardDialect.StandardCriteriaBuilder, StandardDialect.StandardExpressionFunctions, StandardDialect.StandardJdbcMappingVisitor, StandardDialect.StandardScriptBlockContext, StandardDialect.StandardSqlLogFormattingVisitor -
Field Summary
FieldsModifier and TypeFieldDescriptionthe JDBC type forResultSetprotected static final intthe error code that represents unique violationFields inherited from class org.seasar.doma.jdbc.dialect.StandardDialect
CLOSE_QUOTE, expressionFunctions, jdbcMappingVisitor, OPEN_QUOTE, sqlLogFormattingVisitor, UNIQUE_CONSTRAINT_VIOLATION_STATE_CODES -
Constructor Summary
ConstructorsConstructorDescriptionOracle11Dialect(ExpressionFunctions expressionFunctions) Oracle11Dialect(JdbcMappingVisitor jdbcMappingVisitor) Oracle11Dialect(JdbcMappingVisitor jdbcMappingVisitor, SqlLogFormattingVisitor sqlLogFormattingVisitor) Oracle11Dialect(JdbcMappingVisitor jdbcMappingVisitor, SqlLogFormattingVisitor sqlLogFormattingVisitor, ExpressionFunctions expressionFunctions) Oracle11Dialect(SqlLogFormattingVisitor sqlLogFormattingVisitor) -
Method Summary
Modifier and TypeMethodDescriptionCreates the context object to process an SQL block in a script.Returns the criteria builder for this dialect.getName()Returns the name of this dialect.Returns the delimiter that is used as the end of an SQL block in a script.getSequenceNextValSql(String qualifiedSequenceName, long allocationSize) Returns an SQL object to retrieve the next value from a database sequence.booleanisUniqueConstraintViolated(SQLException sqlException) Determines whether the given SQLException represents a unique constraint violation.booleanDetermines whether this dialect supports auto-increment columns when inserting multiple rows.booleanDetermines whether this dialect supports reliable results fromStatement.executeBatch().booleanDetermines whether this dialect supports the IDENTITY column.booleanDetermines whether this object supports mod operator%.booleanDetermines whether this dialect supports multi-row insert statements (bulk inserts).booleanDetermines whether this dialect supports result sets as OUT parameters in stored procedures.booleansupportsSelectForUpdate(SelectForUpdateType type, boolean withTargets) Determines whether this dialect supports pessimistic locking with the specified options.booleanDetermines whether this dialect supports database sequences.protected SqlNodetoForUpdateSqlNode(SqlNode sqlNode, SelectForUpdateType forUpdateType, int waitSeconds, String... aliases) protected SqlNodetoPagingSqlNode(SqlNode sqlNode, long offset, long limit) Methods inherited from class org.seasar.doma.jdbc.dialect.StandardDialect
applyQuote, getAutoGeneratedKeysType, getCauseSQLException, getDeleteAssembler, getErrorCode, getExpressionFunctions, getIdentityReservationSql, getIdentitySelectSql, getInsertAssembler, getJdbcMappingVisitor, getMultiInsertAssembler, getRootCause, getSqlLogFormattingVisitor, getSQLState, getUpdateAssembler, getUpsertAssembler, includesIdentityColumn, removeQuote, supportsAutoGeneratedKeys, supportsIdentityReservation, toCountCalculatingSqlNode, toCountGettingSqlNode, transformSelectSqlNode, transformSelectSqlNodeForGettingCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.seasar.doma.jdbc.dialect.Dialect
includesIdentityColumn, supportsAliasInDeleteClause, supportsAliasInDeleteStatement, supportsAliasInUpdateClause, supportsAliasInUpdateStatement, supportsBatchExecutionReturningGeneratedValues, supportsParenthesesForSetOperands, supportsReturning, supportsUpsertEmulationWithMergeStatement
-
Field Details
-
UNIQUE_CONSTRAINT_VIOLATION_ERROR_CODE
protected static final int UNIQUE_CONSTRAINT_VIOLATION_ERROR_CODEthe error code that represents unique violation- See Also:
-
RESULT_SET
the JDBC type forResultSet
-
-
Constructor Details
-
Oracle11Dialect
public Oracle11Dialect() -
Oracle11Dialect
-
Oracle11Dialect
-
Oracle11Dialect
-
Oracle11Dialect
public Oracle11Dialect(JdbcMappingVisitor jdbcMappingVisitor, SqlLogFormattingVisitor sqlLogFormattingVisitor) -
Oracle11Dialect
public Oracle11Dialect(JdbcMappingVisitor jdbcMappingVisitor, SqlLogFormattingVisitor sqlLogFormattingVisitor, ExpressionFunctions expressionFunctions)
-
-
Method Details
-
getName
Description copied from interface:DialectReturns 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:
getNamein interfaceDialect- Overrides:
getNamein classStandardDialect- Returns:
- the name of this dialect
-
supportsBatchUpdateResults
public boolean supportsBatchUpdateResults()Description copied from interface:DialectDetermines whether this dialect supports reliable results fromStatement.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:
supportsBatchUpdateResultsin interfaceDialect- Overrides:
supportsBatchUpdateResultsin classStandardDialect- Returns:
trueif this dialect supports reliable batch update results,falseotherwise
-
toForUpdateSqlNode
protected SqlNode toForUpdateSqlNode(SqlNode sqlNode, SelectForUpdateType forUpdateType, int waitSeconds, String... aliases) - Overrides:
toForUpdateSqlNodein classStandardDialect
-
toPagingSqlNode
- Overrides:
toPagingSqlNodein classStandardDialect
-
isUniqueConstraintViolated
Description copied from interface:DialectDetermines 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:
isUniqueConstraintViolatedin interfaceDialect- Overrides:
isUniqueConstraintViolatedin classStandardDialect- Parameters:
sqlException- the SQL exception to analyze- Returns:
trueif the exception represents a unique constraint violation,falseotherwise
-
getSequenceNextValSql
Description copied from interface:DialectReturns 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()returnstrue.- Specified by:
getSequenceNextValSqlin interfaceDialect- Overrides:
getSequenceNextValSqlin classStandardDialect- Parameters:
qualifiedSequenceName- the fully qualified name of the sequence, which may include catalog and schema information depending on the database systemallocationSize- 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:DialectDetermines 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:
supportsIdentityin interfaceDialect- Overrides:
supportsIdentityin classStandardDialect- Returns:
trueif this dialect supports IDENTITY columns,falseotherwise
-
supportsSequence
public boolean supportsSequence()Description copied from interface:DialectDetermines 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:
supportsSequencein interfaceDialect- Overrides:
supportsSequencein classStandardDialect- Returns:
trueif this dialect supports sequences,falseotherwise
-
supportsSelectForUpdate
Description copied from interface:DialectDetermines 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:
supportsSelectForUpdatein interfaceDialect- Overrides:
supportsSelectForUpdatein classStandardDialect- Parameters:
type- the type of pessimistic locking (e.g., standard FOR UPDATE, NOWAIT, WAIT)withTargets-trueif specific columns are targeted for locking,falsefor row-level locking- Returns:
trueif this dialect supports the specified locking options,falseotherwise
-
supportsResultSetReturningAsOutParameter
public boolean supportsResultSetReturningAsOutParameter()Description copied from interface:DialectDetermines 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:
supportsResultSetReturningAsOutParameterin interfaceDialect- Overrides:
supportsResultSetReturningAsOutParameterin classStandardDialect- Returns:
trueif this dialect supports result sets as OUT parameters,falseotherwise
-
supportsModOperator
public boolean supportsModOperator()Description copied from interface:DialectDetermines whether this object supports mod operator%.- Returns:
true, if this object supports it
-
supportsMultiRowInsertStatement
public boolean supportsMultiRowInsertStatement()Description copied from interface:DialectDetermines 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:
trueif this dialect supports multi-row insert statements,falseotherwise
-
supportsAutoIncrementWhenInsertingMultipleRows
public boolean supportsAutoIncrementWhenInsertingMultipleRows()Description copied from interface:DialectDetermines 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:
trueif this dialect supports auto-increment columns in multi-row inserts,falseotherwise
-
getResultSetType
Description copied from interface:DialectReturns theJdbcTypeobject that corresponds to theResultSetclass.This method is available, only if
Dialect.supportsResultSetReturningAsOutParameter()istrue.- Specified by:
getResultSetTypein interfaceDialect- Overrides:
getResultSetTypein classStandardDialect- Returns:
- the
JdbcTypeobject for theResultSetclass
-
getScriptBlockDelimiter
Description copied from interface:DialectReturns the delimiter that is used as the end of an SQL block in a script.- Specified by:
getScriptBlockDelimiterin interfaceDialect- Overrides:
getScriptBlockDelimiterin classStandardDialect- Returns:
- the delimiter
-
createScriptBlockContext
Description copied from interface:DialectCreates the context object to process an SQL block in a script.- Specified by:
createScriptBlockContextin interfaceDialect- Overrides:
createScriptBlockContextin classStandardDialect- Returns:
- the context object
-
getCriteriaBuilder
Description copied from interface:DialectReturns 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:
getCriteriaBuilderin interfaceDialect- Overrides:
getCriteriaBuilderin classStandardDialect- Returns:
- the criteria builder for this dialect
-