java.lang.Object
st.orm.spi.DefaultSqlDialect
- All Implemented Interfaces:
SqlDialect
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the limit should be applied after the SELECT clause,falseto apply the limit at the end of the query.booleanReturnstrueif the lock hint should be applied after the FROM clause,falseto apply the lock hint at the end of the query.Escapes the given database identifier (e.g., table or column name) according to this SQL dialect.Returns the lock hint for a shared reading lock.Returns the lock hint for a write lock.Returns the pattern for identifiers.Returns the pattern for multi line comments.Returns the pattern for string literals.Returns the pattern for single line comments.Returns the pattern for valid identifiers.booleanIndicates whether the given name is a keyword in this SQL dialect.limit(int limit) Returns a string template for the given limit.limit(int limit, int offset) Returns a string template for the given limit and offset.Returns a string for the given column name.name()Returns the name of the SQL dialect.offset(int offset) Returns a string template for the given offset.booleanIndicates whether the SQL dialect supports delete aliases.booleanIndicates whether the SQL dialect supports multi-value tuples in the IN clause.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface st.orm.template.SqlDialect
getSafeIdentifier
-
Field Details
-
ANSI_KEYWORDS
-
-
Constructor Details
-
DefaultSqlDialect
public DefaultSqlDialect()
-
-
Method Details
-
name
Returns the name of the SQL dialect.- Specified by:
namein interfaceSqlDialect- Returns:
- the name of the SQL dialect.
- Since:
- 1.2
-
supportsDeleteAlias
public boolean supportsDeleteAlias()Indicates whether the SQL dialect supports delete aliases.Delete aliases allow delete statements to use table aliases in joins, making it easier to filter rows based on related data.
- Specified by:
supportsDeleteAliasin interfaceSqlDialect- Returns:
trueif delete aliases are supported,falseotherwise.
-
supportsMultiValueTuples
public boolean supportsMultiValueTuples()Indicates whether the SQL dialect supports multi-value tuples in the IN clause.- Specified by:
supportsMultiValueTuplesin interfaceSqlDialect- Returns:
trueif multi-value tuples are supported,falseotherwise.- Since:
- 1.2
-
getValidIdentifierPattern
Returns the pattern for valid identifiers.- Specified by:
getValidIdentifierPatternin interfaceSqlDialect- Returns:
- the pattern for valid identifiers.
- Since:
- 1.2
-
isKeyword
Indicates whether the given name is a keyword in this SQL dialect.- Specified by:
isKeywordin interfaceSqlDialect- Parameters:
name- the name to check.- Returns:
trueif the name is a keyword,falseotherwise.- Since:
- 1.2
-
escape
Escapes the given database identifier (e.g., table or column name) according to this SQL dialect.- Specified by:
escapein interfaceSqlDialect- Parameters:
name- the identifier to escape (must not benull)- Returns:
- the escaped identifier
-
getSingleLineCommentPattern
Returns the pattern for single line comments.- Specified by:
getSingleLineCommentPatternin interfaceSqlDialect- Returns:
- the pattern for single line comments.
- Since:
- 1.2
-
getMultiLineCommentPattern
Returns the pattern for multi line comments.- Specified by:
getMultiLineCommentPatternin interfaceSqlDialect- Returns:
- the pattern for multi line comments.
- Since:
- 1.2
-
getIdentifierPattern
Returns the pattern for identifiers.- Specified by:
getIdentifierPatternin interfaceSqlDialect- Returns:
- the pattern for identifiers.
- Since:
- 1.2
-
getQuoteLiteralPattern
Returns the pattern for string literals.- Specified by:
getQuoteLiteralPatternin interfaceSqlDialect- Returns:
- the pattern for string literals.
- Since:
- 1.2
-
multiValueIn
public String multiValueIn(@Nonnull List<Map<String, Object>> values, @Nonnull Consumer<Object> parameterConsumer) throws SqlTemplateExceptionReturns a string for the given column name.- Specified by:
multiValueInin interfaceSqlDialect- Parameters:
values- the (multi) values to use in the IN clause.parameterConsumer- the consumer for the parameters.- Returns:
- the string that represents the multi value IN clause.
- Throws:
SqlTemplateException- if the values are incompatible.- Since:
- 1.2
-
applyLimitAfterSelect
public boolean applyLimitAfterSelect()Returnstrueif the limit should be applied after the SELECT clause,falseto apply the limit at the end of the query.- Specified by:
applyLimitAfterSelectin interfaceSqlDialect- Returns:
trueif the limit should be applied after the SELECT clause,falseto apply the limit at the end of the query.- Since:
- 1.2
-
limit
Returns a string template for the given limit.- Specified by:
limitin interfaceSqlDialect- Parameters:
limit- the maximum number of records to return.- Returns:
- a string template for the given limit.
- Since:
- 1.2
-
offset
Returns a string template for the given offset.- Specified by:
offsetin interfaceSqlDialect- Parameters:
offset- the offset.- Returns:
- a string template for the given offset.
- Since:
- 1.2
-
limit
Returns a string template for the given limit and offset.- Specified by:
limitin interfaceSqlDialect- Parameters:
limit- the maximum number of records to return.offset- the offset.- Returns:
- a string template for the given limit and offset.
- Since:
- 1.2
-
applyLockHintAfterFrom
public boolean applyLockHintAfterFrom()Returnstrueif the lock hint should be applied after the FROM clause,falseto apply the lock hint at the end of the query.- Specified by:
applyLockHintAfterFromin interfaceSqlDialect- Returns:
trueif the lock hint should be applied after the FROM clause,falseto apply the lock hint at the end of the query.- Since:
- 1.2
-
forUpdateLockHint
Returns the lock hint for a write lock.- Specified by:
forUpdateLockHintin interfaceSqlDialect- Returns:
- the lock hint for a write lock.
- Since:
- 1.2
-