Class H2Dialect
java.lang.Object
io.github.torand.fastersql.dialect.H2Dialect
- All Implemented Interfaces:
Dialect
Defines the H2 SQL dialect.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatCeilFunction
(String operand) Returns the 'ceil' function formatted for a specific SQL dialect.formatConcatFunction
(List<String> operands) Returns the 'concat' function formatted for a specific SQL dialect.Returns the 'current_date' system function formatted for a specific SQL dialect.formatLengthFunction
(String operand) Returns the 'length' function formatted for a specific SQL dialect.formatLnFunction
(String operand) Returns the 'ln' function formatted for a specific SQL dialect.formatModuloFunction
(String divisor, String dividend) Returns the 'mod' function formatted for a specific SQL dialect.formatRoundFunction
(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.formatSubstringFunction
(String operand, int startPos, int length) Returns the 'substring' function formatted for a specific SQL dialect.formatToCharFunction
(String operand, String format) Returns the 'to_char' function formatted for a specific SQL dialect.formatToNumberFunction
(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.Gets the name of the RDBMS product associated with this SQL dialect.boolean
Indicates whether offset clause must be specified before limit clause; if supported.boolean
supports
(Capability capability) Indicates whether a capability is supported by a specific SQL dialect.withCustomizations
(Connection connection) Adds some user defined functions emulating common SQL constructs not supported by default.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.torand.fastersql.dialect.Dialect
formatPowerFunction
-
Constructor Details
-
H2Dialect
public H2Dialect()Creates a H2Dialect
implementation.
-
-
Method Details
-
getProductName
Description copied from interface:Dialect
Gets the name of the RDBMS product associated with this SQL dialect.- Specified by:
getProductName
in interfaceDialect
- Returns:
- the name of the RDBMS product.
-
offsetBeforeLimit
public boolean offsetBeforeLimit()Description copied from interface:Dialect
Indicates whether offset clause must be specified before limit clause; if supported.- Specified by:
offsetBeforeLimit
in interfaceDialect
- Returns:
- whether offset clause must be specified before limit clause; if supported.
-
formatRowOffsetClause
Description copied from interface:Dialect
Returns the row offset clause formatted for a specific SQL dialect.- Specified by:
formatRowOffsetClause
in interfaceDialect
- Returns:
- the row offset clause formatted for a specific SQL dialect.
-
formatRowLimitClause
Description copied from interface:Dialect
Returns the row limit clause formatted for a specific SQL dialect.- Specified by:
formatRowLimitClause
in interfaceDialect
- Returns:
- the row limit clause formatted for a specific SQL dialect.
-
formatRowNumLiteral
Description copied from interface:Dialect
Returns the row number literal formatted for a specific SQL dialect.- Specified by:
formatRowNumLiteral
in interfaceDialect
- Returns:
- the row number literal formatted for a specific SQL dialect.
-
formatToNumberFunction
Description copied from interface:Dialect
Returns the 'to_number' function formatted for a specific SQL dialect.- Specified by:
formatToNumberFunction
in interfaceDialect
- 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
Description copied from interface:Dialect
Returns the 'to_char' function formatted for a specific SQL dialect.- Specified by:
formatToCharFunction
in interfaceDialect
- 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
Description copied from interface:Dialect
Returns the 'substring' function formatted for a specific SQL dialect.- Specified by:
formatSubstringFunction
in interfaceDialect
- 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
Description copied from interface:Dialect
Returns the 'concat' function formatted for a specific SQL dialect.- Specified by:
formatConcatFunction
in interfaceDialect
- Parameters:
operands
- the string expressions to concatenate- Returns:
- the 'concat' function for a specific SQL dialect.
-
formatLengthFunction
Description copied from interface:Dialect
Returns the 'length' function formatted for a specific SQL dialect.- Specified by:
formatLengthFunction
in interfaceDialect
- Parameters:
operand
- the string expression to get length of- Returns:
- the 'length' function for a specific SQL dialect.
-
formatCeilFunction
Description copied from interface:Dialect
Returns the 'ceil' function formatted for a specific SQL dialect.- Specified by:
formatCeilFunction
in interfaceDialect
- Parameters:
operand
- the numeric expression to get ceiling of- Returns:
- the 'ceil' function for a specific SQL dialect.
-
formatLnFunction
Description copied from interface:Dialect
Returns the 'ln' function formatted for a specific SQL dialect.- Specified by:
formatLnFunction
in interfaceDialect
- Parameters:
operand
- the numeric expression to get natural logarithm of- Returns:
- the 'ln' function for a specific SQL dialect.
-
formatRoundFunction
Description copied from interface:Dialect
Returns the 'round' function formatted for a specific SQL dialect.- Specified by:
formatRoundFunction
in interfaceDialect
- Parameters:
operand
- the numeric expression to perform rounding on- Returns:
- the 'round' function for a specific SQL dialect.
-
formatModuloFunction
Description copied from interface:Dialect
Returns the 'mod' function formatted for a specific SQL dialect.- Specified by:
formatModuloFunction
in interfaceDialect
- Parameters:
divisor
- the numeric expression for divisor operanddividend
- the numeric expression for dividend operand- Returns:
- the 'mod' function for a specific SQL dialect.
-
formatCurrentDateFunction
Description copied from interface:Dialect
Returns the 'current_date' system function formatted for a specific SQL dialect.- Specified by:
formatCurrentDateFunction
in interfaceDialect
- Returns:
- the 'current_date' function for a specific SQL dialect.
-
getConcatOperator
Description copied from interface:Dialect
Returns the string concatenation operator for a specific SQL Dialect.- Specified by:
getConcatOperator
in interfaceDialect
- Returns:
- the string concatenation operator for a specific SQL Dialect.
-
supports
Description copied from interface:Dialect
Indicates whether a capability is supported by a specific SQL dialect. -
withCustomizations
Adds some user defined functions emulating common SQL constructs not supported by default.- Parameters:
connection
- a live H2 connection.- Returns:
- the modified dialect.
-