public class StandardDialect extends java.lang.Object implements Dialect
Dialect.| Modifier and Type | Class and Description |
|---|---|
static class |
StandardDialect.StandardCriteriaBuilder |
static class |
StandardDialect.StandardExpressionFunctions
A standard implementation of
ExpressionFunctions. |
static class |
StandardDialect.StandardJdbcMappingVisitor |
static class |
StandardDialect.StandardScriptBlockContext
A standard implementation of
ScriptBlockContext. |
static class |
StandardDialect.StandardSqlLogFormattingVisitor |
| Modifier and Type | Field and Description |
|---|---|
protected static char |
CLOSE_QUOTE
the quotation mark of the end
|
protected ExpressionFunctions |
expressionFunctions
the aggregation of expression functions
|
protected JdbcMappingVisitor |
jdbcMappingVisitor
|
protected static char |
OPEN_QUOTE
the quotation mark of the start
|
protected SqlLogFormattingVisitor |
sqlLogFormattingVisitor
the visitor that maps
Wrapper to SqlLogFormatter |
protected static java.util.Set<java.lang.String> |
UNIQUE_CONSTRAINT_VIOLATION_STATE_CODES
the set of SQLState code that represents unique violation
|
| Constructor and Description |
|---|
StandardDialect() |
StandardDialect(ExpressionFunctions expressionFunctions) |
StandardDialect(JdbcMappingVisitor jdbcMappingVisitor) |
StandardDialect(JdbcMappingVisitor jdbcMappingVisitor,
SqlLogFormattingVisitor sqlLogFormattingVisitor) |
StandardDialect(JdbcMappingVisitor jdbcMappingVisitor,
SqlLogFormattingVisitor sqlLogFormattingVisitor,
ExpressionFunctions expressionFunctions) |
StandardDialect(SqlLogFormattingVisitor sqlLogFormattingVisitor) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
applyQuote(java.lang.String name)
Enclose the name with quotation marks.
|
ScriptBlockContext |
createScriptBlockContext()
Creates the context object to process an SQL block in a script.
|
AutoGeneratedKeysType |
getAutoGeneratedKeysType()
Returns the type of the auto generated keys.
|
protected java.sql.SQLException |
getCauseSQLException(java.sql.SQLException sqlException) |
CriteriaBuilder |
getCriteriaBuilder() |
protected int |
getErrorCode(java.sql.SQLException sqlException) |
ExpressionFunctions |
getExpressionFunctions()
Returns the aggregation of the expression functions that are available in the SQL templates.
|
Sql<?> |
getIdentityReservationSql(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String columnName,
boolean isQuoteRequired,
boolean isIdColumnQuoteRequired,
int reservationSize)
Returns an SQL object to reserve identity in the database.
|
Sql<?> |
getIdentitySelectSql(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String columnName,
boolean isQuoteRequired,
boolean isIdColumnQuoteRequired)
Returns an SQL object to get IDENTITY values that are generated in the database.
|
JdbcMappingVisitor |
getJdbcMappingVisitor()
|
java.lang.String |
getName()
The dialect name.
|
JdbcType<java.sql.ResultSet> |
getResultSetType()
Returns the
JdbcType object that corresponds to the ResultSet class. |
java.lang.Throwable |
getRootCause(java.sql.SQLException sqlException)
Returns the root cause of the SQL exception.
|
java.lang.String |
getScriptBlockDelimiter()
Return the delimiter that is used as the end of an SQL block in a script.
|
PreparedSql |
getSequenceNextValSql(java.lang.String qualifiedSequenceName,
long allocationSize)
Returns an SQL object to get next sequence values.
|
SqlLogFormattingVisitor |
getSqlLogFormattingVisitor()
Return the visitor that maps
Wrapper to SqlLogFormatter. |
protected java.lang.String |
getSQLState(java.sql.SQLException sqlException) |
UpsertAssembler |
getUpsertAssembler(UpsertAssemblerContext context)
Returns the UpsertAssembler implementation for the given context.
|
boolean |
includesIdentityColumn()
Whether this object includes the IDENTITY column in SQL INSERT statements.
|
boolean |
isUniqueConstraintViolated(java.sql.SQLException sqlException)
Whether the
sqlException represents an unique violation. |
java.lang.String |
removeQuote(java.lang.String name)
Remove quotation marks from the name
|
boolean |
supportsAutoGeneratedKeys()
Whether this object supports
Statement.getGeneratedKeys(). |
boolean |
supportsBatchUpdateResults()
Whether this object supports the result of
Statement.executeBatch(). |
boolean |
supportsIdentity()
Whether this object supports the IDENTITY column.
|
boolean |
supportsIdentityReservation()
Whether this object supports a reservation of identity.
|
boolean |
supportsResultSetReturningAsOutParameter()
Whether this object supports an out parameter that is mapped to a result set in stored
functions or stored procedures .
|
boolean |
supportsSelectForUpdate(SelectForUpdateType type,
boolean withTargets)
Whether this object supports pessimistic locking.
|
boolean |
supportsSequence()
Whether this object supports the SEQUENCE.
|
protected SqlNode |
toCountCalculatingSqlNode(SqlNode sqlNode) |
protected SqlNode |
toCountGettingSqlNode(SqlNode sqlNode) |
protected SqlNode |
toForUpdateSqlNode(SqlNode sqlNode,
SelectForUpdateType forUpdateType,
int waitSeconds,
java.lang.String... aliases) |
protected SqlNode |
toPagingSqlNode(SqlNode sqlNode,
long offset,
long limit) |
SqlNode |
transformSelectSqlNode(SqlNode sqlNode,
SelectOptions options)
Transforms the SQL node.
|
SqlNode |
transformSelectSqlNodeForGettingCount(SqlNode sqlNode)
Transforms the SQL node to get a row count.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsupportsAliasInDeleteClause, supportsAliasInUpdateClause, supportsBatchExecutionReturningGeneratedValues, supportsModOperatorprotected static final char OPEN_QUOTE
protected static final char CLOSE_QUOTE
protected static final java.util.Set<java.lang.String> UNIQUE_CONSTRAINT_VIOLATION_STATE_CODES
protected final JdbcMappingVisitor jdbcMappingVisitor
protected final SqlLogFormattingVisitor sqlLogFormattingVisitor
Wrapper to SqlLogFormatterprotected final ExpressionFunctions expressionFunctions
public StandardDialect()
public StandardDialect(JdbcMappingVisitor jdbcMappingVisitor)
public StandardDialect(SqlLogFormattingVisitor sqlLogFormattingVisitor)
public StandardDialect(ExpressionFunctions expressionFunctions)
public StandardDialect(JdbcMappingVisitor jdbcMappingVisitor, SqlLogFormattingVisitor sqlLogFormattingVisitor)
public StandardDialect(JdbcMappingVisitor jdbcMappingVisitor, SqlLogFormattingVisitor sqlLogFormattingVisitor, ExpressionFunctions expressionFunctions)
public java.lang.String getName()
Dialectpublic SqlNode transformSelectSqlNode(SqlNode sqlNode, SelectOptions options)
DialecttransformSelectSqlNode in interface DialectsqlNode - the SQL nodeoptions - the optionsprotected SqlNode toForUpdateSqlNode(SqlNode sqlNode, SelectForUpdateType forUpdateType, int waitSeconds, java.lang.String... aliases)
public SqlNode transformSelectSqlNodeForGettingCount(SqlNode sqlNode)
DialecttransformSelectSqlNodeForGettingCount in interface DialectsqlNode - the SQL nodepublic boolean isUniqueConstraintViolated(java.sql.SQLException sqlException)
DialectsqlException represents an unique violation.isUniqueConstraintViolated in interface DialectsqlException - the SQL exceptiontrue, if the sqlException represents an unique violationprotected java.lang.String getSQLState(java.sql.SQLException sqlException)
protected int getErrorCode(java.sql.SQLException sqlException)
protected java.sql.SQLException getCauseSQLException(java.sql.SQLException sqlException)
public java.lang.Throwable getRootCause(java.sql.SQLException sqlException)
DialectgetRootCause in interface DialectsqlException - the SQL exceptionpublic boolean supportsAutoGeneratedKeys()
DialectStatement.getGeneratedKeys().supportsAutoGeneratedKeys in interface Dialecttrue, if this object supports itpublic boolean supportsBatchUpdateResults()
DialectStatement.executeBatch().supportsBatchUpdateResults in interface Dialecttrue, if this object supports itpublic boolean supportsIdentity()
DialectsupportsIdentity in interface Dialecttrue, if this object supports itpublic boolean supportsSequence()
DialectsupportsSequence in interface Dialecttrue, if this object supports itpublic boolean supportsIdentityReservation()
DialectsupportsIdentityReservation in interface Dialecttrue, if this object supports itpublic boolean includesIdentityColumn()
DialectincludesIdentityColumn in interface Dialecttrue, if this object includes itpublic boolean supportsSelectForUpdate(SelectForUpdateType type, boolean withTargets)
DialectsupportsSelectForUpdate in interface Dialecttype - a kind of pessimistic lockingwithTargets - true if a lock target is specifiedtrue, if this object supports itpublic boolean supportsResultSetReturningAsOutParameter()
DialectsupportsResultSetReturningAsOutParameter in interface Dialecttrue, if this object supports itpublic JdbcType<java.sql.ResultSet> getResultSetType()
DialectJdbcType object that corresponds to the ResultSet class.
This method is available, only if Dialect.supportsResultSetReturningAsOutParameter() is
true.
getResultSetType in interface DialectJdbcType object for the ResultSet classpublic Sql<?> getIdentitySelectSql(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName, boolean isQuoteRequired, boolean isIdColumnQuoteRequired)
DialectThis method is available, only if Dialect.supportsIdentity() returns true.
getIdentitySelectSql in interface DialectcatalogName - the catalog nameschemaName - the schema nametableName - the table namecolumnName - the IDENTITY column nameisQuoteRequired - whether the quotation marks are requiredisIdColumnQuoteRequired - whether the quotation marks are required for the IDENTITY columnpublic Sql<?> getIdentityReservationSql(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName, boolean isQuoteRequired, boolean isIdColumnQuoteRequired, int reservationSize)
DialectThis method is available, only if Dialect.supportsIdentityReservation() returns true.
getIdentityReservationSql in interface DialectcatalogName - the catalog nameschemaName - the schema nametableName - the table namecolumnName - the IDENTITY column nameisQuoteRequired - whether the quotation marks are requiredisIdColumnQuoteRequired - whether the quotation marks are required for the IDENTITY columnreservationSize - the size of the reservationpublic PreparedSql getSequenceNextValSql(java.lang.String qualifiedSequenceName, long allocationSize)
DialectThis method is available, only if Dialect.supportsSequence() returns true.
getSequenceNextValSql in interface DialectqualifiedSequenceName - the qualified sequence nameallocationSize - the allocation size of the sequencepublic java.lang.String applyQuote(java.lang.String name)
DialectapplyQuote in interface Dialectname - the name of a database object such as a table, a column, and so onpublic java.lang.String removeQuote(java.lang.String name)
DialectremoveQuote in interface Dialectname - the name of a database object such as a table, a column, and so onpublic JdbcMappingVisitor getJdbcMappingVisitor()
DialectgetJdbcMappingVisitor in interface Dialectpublic SqlLogFormattingVisitor getSqlLogFormattingVisitor()
DialectWrapper to SqlLogFormatter.getSqlLogFormattingVisitor in interface Dialectpublic ExpressionFunctions getExpressionFunctions()
DialectgetExpressionFunctions in interface Dialectpublic ScriptBlockContext createScriptBlockContext()
DialectcreateScriptBlockContext in interface Dialectpublic java.lang.String getScriptBlockDelimiter()
DialectgetScriptBlockDelimiter in interface Dialectpublic AutoGeneratedKeysType getAutoGeneratedKeysType()
DialectgetAutoGeneratedKeysType in interface Dialectpublic CriteriaBuilder getCriteriaBuilder()
getCriteriaBuilder in interface Dialectpublic UpsertAssembler getUpsertAssembler(UpsertAssemblerContext context)
DialectgetUpsertAssembler in interface Dialectcontext - the UpsertAssemblerContext object