Interface Dialect
- All Known Implementing Classes:
AccessDialect,AnsiIsoDialect,H2Dialect,HsqldbDialect,MariaDbDialect,MySqlDialect,OracleDialect,PostgreSqlDialect,SqliteDialect,SqlServerDialect
public interface Dialect
Defines an SQL dialect as implemented by a specific database vendor.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringformatCastFunction(String operand, DataType targetType) Returns the 'cast' function formatted for a specific SQL dialect.default StringformatCeilFunction(String operand) Returns the 'ceil' function formatted for a specific SQL dialect.default StringformatConcatFunction(List<String> operands) Returns the 'concat' function formatted for a specific SQL dialect.default StringReturns the 'current_date' system function formatted for a specific SQL dialect.default StringformatLengthFunction(String operand) Returns the 'length' function formatted for a specific SQL dialect.default StringformatLnFunction(String operand) Returns the 'ln' function formatted for a specific SQL dialect.default StringformatModuloFunction(String divisor, String dividend) Returns the 'mod' function formatted for a specific SQL dialect.default StringformatPowerFunction(String base, String exponent) Returns the 'pow' function formatted for a specific SQL dialect.default StringformatRoundFunction(String operand) Returns the 'round' function formatted for a specific SQL dialect.Returns the row limit clause formatted for a specific SQL dialect.Returns the row number literal formatted for a specific SQL dialect.Returns the row offset clause formatted for a specific SQL dialect.default StringformatSetOperator(SetOperator setOperator) Returns the specified set operator formatted for a specific SQL dialect.default StringformatSubstringFunction(String operand, int startPos, int length) Returns the 'substring' function formatted for a specific SQL dialect.default StringformatToCharFunction(String operand, String format) Returns the 'to_char' function formatted for a specific SQL dialect.default StringformatToNumberFunction(String operand, int precision, int scale) Returns the 'to_number' function formatted for a specific SQL dialect.Returns the string concatenation operator for a specific SQL Dialect.getDataType(DataType dataType) Returns the data type for a specific SQL dialect.Gets the name of the RDBMS product associated with this SQL dialect.default booleanIndicates whether offset clause must be specified before limit clause; if supported.booleansupports(Capability capability) Indicates whether a capability is supported by a specific SQL dialect.
-
Method Details
-
getProductName
String getProductName()Gets the name of the RDBMS product associated with this SQL dialect.- Returns:
- the name of the RDBMS product.
-
offsetBeforeLimit
default boolean offsetBeforeLimit()Indicates whether offset clause must be specified before limit clause; if supported.- Returns:
- whether offset clause must be specified before limit clause; if supported.
-
formatRowOffsetClause
Returns the row offset clause formatted for a specific SQL dialect.- Returns:
- the row offset clause formatted for a specific SQL dialect.
-
formatRowLimitClause
Returns the row limit clause formatted for a specific SQL dialect.- Returns:
- the row limit clause formatted for a specific SQL dialect.
-
formatRowNumLiteral
Returns the row number literal formatted for a specific SQL dialect.- Returns:
- the row number literal formatted for a specific SQL dialect.
-
formatSetOperator
Returns the specified set operator formatted for a specific SQL dialect.- Parameters:
setOperator- the set operator.- Returns:
- the set operator for a specific SQL dialect.
-
formatToNumberFunction
Returns the 'to_number' function formatted for a specific SQL dialect.- Parameters:
operand- the string expression to be evaluated as a numberprecision- the precision that represents the number of significant digitsscale- the scale that that represents the number of digits after the decimal point. Must be less than or equal to the precision.- Returns:
- the 'to_number' function for a specific SQL dialect.
-
formatToCharFunction
Returns the 'to_char' function formatted for a specific SQL dialect.- Parameters:
operand- the expression to be evaluated as a stringformat- the vendor-specific format mask- Returns:
- the 'to_char' function for a specific SQL dialect.
-
formatSubstringFunction
Returns the 'substring' function formatted for a specific SQL dialect.- Parameters:
operand- the string expression to get substring fromstartPos- the start position (1-based) of the substringlength- the length of the substring- Returns:
- the 'substring' function for a specific SQL dialect.
-
formatConcatFunction
Returns the 'concat' function formatted for a specific SQL dialect.- Parameters:
operands- the string expressions to concatenate- Returns:
- the 'concat' function for a specific SQL dialect.
-
formatLengthFunction
Returns the 'length' function formatted for a specific SQL dialect.- Parameters:
operand- the string expression to get length of- Returns:
- the 'length' function for a specific SQL dialect.
-
formatCeilFunction
Returns the 'ceil' function formatted for a specific SQL dialect.- Parameters:
operand- the numeric expression to get ceiling of- Returns:
- the 'ceil' function for a specific SQL dialect.
-
formatLnFunction
Returns the 'ln' function formatted for a specific SQL dialect.- Parameters:
operand- the numeric expression to get natural logarithm of- Returns:
- the 'ln' function for a specific SQL dialect.
-
formatPowerFunction
Returns the 'pow' function formatted for a specific SQL dialect.- Parameters:
base- the numeric expression for base operandexponent- the numeric expression for exponent operand- Returns:
- the 'pow' function for a specific SQL dialect.
-
formatRoundFunction
Returns the 'round' function formatted for a specific SQL dialect.- Parameters:
operand- the numeric expression to perform rounding on- Returns:
- the 'round' function for a specific SQL dialect.
-
formatModuloFunction
Returns the 'mod' function formatted for a specific SQL dialect.- Parameters:
divisor- the numeric expression for divisor operanddividend- the numeric expression for dividend operand- Returns:
- the 'mod' function for a specific SQL dialect.
-
formatCurrentDateFunction
Returns the 'current_date' system function formatted for a specific SQL dialect.- Returns:
- the 'current_date' function for a specific SQL dialect.
-
formatCastFunction
Returns the 'cast' function formatted for a specific SQL dialect.- Parameters:
operand- the expression to cast.targetType- the data type to cast to.- Returns:
- the 'cast' function formatted for a specific SQL dialect.
-
getDataType
Returns the data type for a specific SQL dialect.- Parameters:
dataType- the ISO data type- Returns:
- the data type for a specific SQL dialect.
-
getConcatOperator
Returns the string concatenation operator for a specific SQL Dialect.- Returns:
- the string concatenation operator for a specific SQL Dialect.
-
supports
Indicates whether a capability is supported by a specific SQL dialect.- Parameters:
capability- the capability to check support for- Returns:
- true if specified capability is supported; else false
-