Interface Dialect
- All Known Subinterfaces:
JdbcDialect,R2dbcDialect
- All Known Implementing Classes:
AbstractDialect,AnsiDialect,Db2Dialect,H2Dialect,H2Dialect,HsqlDbDialect,JdbcDb2Dialect,JdbcH2Dialect,JdbcHsqlDbDialect,JdbcMariaDbDialect,JdbcMySqlDialect,JdbcOracleDialect,JdbcPostgresDialect,JdbcSqlServerDialect,MariaDbDialect,MySqlDialect,MySqlDialect,OracleDialect,OracleDialect,PostgresDialect,PostgresDialect,SqlServerDialect,SqlServerDialect
public interface Dialect
Represents a dialect for a particular database.
Note that not all features are supported by all vendors. Dialect implementations provide feature flags and objects
that describe how a database runs certain commands or handles types such as array. Methods for unsupported
functionality may throw UnsupportedOperationException.
- Since:
- 1.1
- Author:
- Mark Paluch, Jens Schauder, Myeonghyeon Lee, Christoph Strobl, Mikhail Polivakha, Chirag Tailor
-
Method Summary
Modifier and TypeMethodDescriptiondefault ArrayColumnsReturns the array support object that describes how array-typed columns should be handled by this dialect.default Collection<Object>Return a collection of converters for this dialect.default SimpleFunctionProvide a SQL function that is suitable for implementing an exists-query.default IdentifierProcessingReturns thehandling of table- and column names (identifiers)used for processingSqlIdentifierwhen converting them to SQL snippets or parameter names.default IdGenerationReturns theIdGenerationused for generating identifiers.default InsertRenderContextdefault EscaperReturns theEscaperused forLIKEvalue escaping.default StringgetName()Returns the name of the dialect.Obtain theSelectRenderContext.default UpsertRenderContextReturns anUpsertRenderContextfor single-statement upsert.limit()Return theLimitClauseused by this dialect.lock()Return theLockClauseused by this dialect.default OrderByNullPrecedenceReturn theOrderByNullPrecedenceused by this dialect.Return theSetof types considered store native types that can be handeled by the driver.default booleanReturn whether the dialect supports single query loading.
-
Method Details
-
getName
Returns the name of the dialect.- Returns:
- the name of the dialect.
- Since:
- 4.1
-
getIdentifierProcessing
Returns thehandling of table- and column names (identifiers)used for processingSqlIdentifierwhen converting them to SQL snippets or parameter names.- Returns:
- the
IdentifierProcessing. Guaranteed to be not null. - Since:
- 2.0
-
getIdGeneration
Returns theIdGenerationused for generating identifiers.- Returns:
- the
IdGenerationused for generating identifiers.
-
lock
LockClause lock()Return theLockClauseused by this dialect.- Returns:
- the
LockClauseused by this dialect.
-
getArraySupport
Returns the array support object that describes how array-typed columns should be handled by this dialect.- Returns:
- the array support object that describes how array-typed columns should be handled by this dialect.
-
getConverters
Return a collection of converters for this dialect.- Returns:
- a collection of converters for this dialect.
-
simpleTypes
Return theSetof types considered store native types that can be handeled by the driver.- Returns:
- never null.
- Since:
- 2.3
-
getExistsFunction
Provide a SQL function that is suitable for implementing an exists-query. The default is `COUNT(1)`, but for some databases aLEAST(COUNT(1), 1)might be required, which doesn't get accepted by other databases.- Since:
- 3.0
-
supportsSingleQueryLoading
default boolean supportsSingleQueryLoading()Return whether the dialect supports single query loading.- Returns:
- true if the dialect supports single query loading; false otherwise.
-
getLikeEscaper
Returns theEscaperused forLIKEvalue escaping.- Returns:
- the
Escaperused forLIKEvalue escaping. - Since:
- 2.0
-
limit
LimitClause limit()Return theLimitClauseused by this dialect.- Returns:
- the
LimitClauseused by this dialect.
-
orderByNullHandling
Return theOrderByNullPrecedenceused by this dialect.- Returns:
- the
OrderByNullPrecedenceused by this dialect. - Since:
- 2.4
-
getSelectContext
SelectRenderContext getSelectContext()Obtain theSelectRenderContext.- Returns:
- the
SelectRenderContext.
-
getInsertRenderContext
- Returns:
- an appropriate
InsertRenderContextfor that specific dialect. for most of the Dialects the default implementation will be valid, but, for example, in case ofSqlServerDialectit is not. - Since:
- 2.4
-
getUpsertRenderContext
Returns anUpsertRenderContextfor single-statement upsert.- Returns:
- the upsert render context, defaults to standard
MERGE. - Throws:
UnsupportedOperationException- if the dialect does not support single-statement upsert.- Since:
- 4.1
-