Top Description Fields Constructors Methods
org.hibernate.dialect

public Class SybaseDialect

extends AbstractTransactSQLDialect
Class Inheritance
Known Direct Subclasses
org.hibernate.dialect.SybaseASEDialect
Imports
java.sql.DatabaseMetaData, .SQLException, .Types, java.time.temporal.TemporalAccessor, java.util.Calendar, .Date, .TimeZone, org.hibernate.boot.model.FunctionContributions, .TypeContributions, org.hibernate.dialect.function.CommonFunctionFactory, .CountFunction, .IntegralTimestampaddFunction, .SybaseTruncFunction, org.hibernate.dialect.identity.AbstractTransactSQLIdentityColumnSupport, .IdentityColumnSupport, .SybaseJconnIdentityColumnSupport, org.hibernate.dialect.unique.SkipNullableUniqueDelegate, .UniqueDelegate, org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo, org.hibernate.engine.jdbc.env.spi.IdentifierCaseStrategy, .IdentifierHelper, .IdentifierHelperBuilder, .NameQualifierSupport, org.hibernate.engine.spi.LoadQueryInfluencers, .SessionFactoryImplementor, org.hibernate.procedure.internal.JTDSCallableStatementSupport, .SybaseCallableStatementSupport, org.hibernate.procedure.spi.CallableStatementSupport, org.hibernate.query.spi.QueryOptions, .QueryParameterBindings, org.hibernate.query.sqm.CastType, .IntervalType, .TemporalUnit, .TrimSpec, org.hibernate.query.sqm.internal.DomainParameterXref, org.hibernate.query.sqm.sql.SqmTranslator, .SqmTranslatorFactory, .StandardSqmTranslatorFactory, org.hibernate.query.sqm.tree.select.SqmSelectStatement, org.hibernate.service.ServiceRegistry, org.hibernate.sql.ast.SqlAstNodeRenderingMode, .SqlAstTranslator, .SqlAstTranslatorFactory, org.hibernate.sql.ast.spi.SqlAppender, .SqlAstCreationContext, .StandardSqlAstTranslatorFactory, org.hibernate.sql.ast.tree.Statement, org.hibernate.sql.ast.tree.select.SelectStatement, org.hibernate.sql.exec.spi.JdbcOperation, org.hibernate.type.JavaObjectType, .NullType, org.hibernate.type.descriptor.jdbc.BlobJdbcType, .ClobJdbcType, .JdbcType, .ObjectNullAsBinaryTypeJdbcType, .TinyIntAsSmallIntJdbcType, org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry, jakarta.persistence.TemporalType

Superclass for all Sybase dialects.
Author
Brett Meyer

Field Summary

Modifier and TypeField and Description
private final SybaseDriverKind
private static final int
protected final boolean
jtdsDriver

Deprecated for removal.
private static final DatabaseVersion
private static final int
private final UniqueDelegate

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
appendDatetimeFormat(SqlAppender appender, String format)

Overrides org.hibernate.dialect.Dialect.appendDatetimeFormat.

Translate the given datetime format string from the pattern language defined by Java's java.time.format.DateTimeFormatter to whatever pattern language is understood by the native datetime formatting function for this database (often the to_char() function).
public void
appendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone)

Overrides org.hibernate.dialect.Dialect.appendDateTimeLiteral.

Append a datetime literal representing the given java.time value to the given SqlAppender.
public void
appendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone)

Overrides org.hibernate.dialect.Dialect.appendDateTimeLiteral.

Append a datetime literal representing the given Date value to the given SqlAppender.
public void
appendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone)

Overrides org.hibernate.dialect.Dialect.appendDateTimeLiteral.

Append a datetime literal representing the given Calendar value to the given SqlAppender.
public IdentifierHelper
buildIdentifierHelper(IdentifierHelperBuilder
A partially-configured IdentifierHelperBuilder.
builder
,
DatabaseMetaData
Access to the metadata returned from the driver if needed and if available

Warning

it may be null.

dbMetaData
)

Overrides org.hibernate.dialect.Dialect.buildIdentifierHelper.

The IdentifierHelper indicated by this dialect for handling identifier conversions.
public boolean
canCreateSchema()

Overrides org.hibernate.dialect.Dialect.canCreateSchema.

Does this dialect support creating and dropping schema?
public String
castPattern(CastType
a CastType indicating the type of the value argument
from
,
CastType
a CastType indicating the type the value argument is cast to
to
)

Overrides org.hibernate.dialect.Dialect.castPattern.

Obtain a pattern for the SQL equivalent to a cast() function call.
public void
contributeTypes(TypeContributions
Callback to contribute the types
typeContributions
,
ServiceRegistry
The service registry
serviceRegistry
)

Overrides org.hibernate.dialect.Dialect.contributeTypes.

A callback which allows the Dialect to contribute types.
public String
extractPattern(TemporalUnit
the first argument
unit
)

Overrides org.hibernate.dialect.Dialect.extractPattern.

Obtain a pattern for the SQL equivalent to an extract() function call.
public String
getAlterColumnTypeString(String
the name of the column
columnName
,
String
the new type of the column
columnType
,
String
the full column definition
columnDefinition
)

Overrides org.hibernate.dialect.Dialect.getAlterColumnTypeString.

The fragment of an alter table command which modifies a column type, or null if column types cannot be modified.
public CallableStatementSupport
public String
getCurrentSchemaCommand()

Overrides org.hibernate.dialect.Dialect.getCurrentSchemaCommand.

Get the SQL command used to retrieve the current schema name.
public SybaseDriverKind
public IdentityColumnSupport
public int
getInExpressionCountLimit()

Overrides org.hibernate.dialect.Dialect.getInExpressionCountLimit.

Return the limit that the underlying database places on the number of elements in an IN predicate.
public int
getMaxIdentifierLength()

Overrides org.hibernate.dialect.Dialect.getMaxIdentifierLength.

What is the maximum identifier length supported by this dialect?
protected DatabaseVersion
getMinimumSupportedVersion()

Overrides org.hibernate.dialect.Dialect.getMinimumSupportedVersion.

Get the version of the SQL dialect that is the minimum supported by this implementation.
public NameQualifierSupport
public NationalizationSupport
getNationalizationSupport()

Overrides org.hibernate.dialect.Dialect.getNationalizationSupport.

Determines whether this database requires the use of explicitly nationalized character (Unicode) data types.
public String
getNullColumnString()

Overrides org.hibernate.dialect.Dialect.getNullColumnString.

The keyword used to specify a nullable column, usually "", but sometimes " null".
public int
getParameterCountLimit()

Overrides org.hibernate.dialect.Dialect.getParameterCountLimit.

Return the limit that the underlying database places on the number of parameters that can be defined for a PreparedStatement.
public SqlAstTranslatorFactory
public SqmTranslatorFactory
public UniqueDelegate
public void
initializeFunctionRegistry(FunctionContributions functionContributions)

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.initializeFunctionRegistry.

Initialize the given registry with any dialect-specific functions.
public JdbcType
resolveSqlTypeDescriptor(String
the column type name
columnTypeName
,
int jdbcTypeCode, int
the precision or 0
precision
,
int
the scale or 0
scale
,
JdbcTypeRegistry jdbcTypeRegistry)

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.resolveSqlTypeDescriptor.

Assigns an appropriate JdbcType to a column of a JDBC result set based on the column type name, JDBC type code, precision, and scale.
public boolean
supportsAlterColumnType()

Overrides org.hibernate.dialect.Dialect.supportsAlterColumnType.

Does this dialect support modifying the type of an existing column?
public boolean
supportsFractionalTimestampArithmetic()

Overrides org.hibernate.dialect.Dialect.supportsFractionalTimestampArithmetic.

Whether the database supports adding a fractional interval to a timestamp, for example timestamp + 0.5 second.
public boolean
public boolean
supportsNullPrecedence()

Overrides org.hibernate.dialect.Dialect.supportsNullPrecedence.

Does this dialect support nulls first and nulls last?
public boolean
supportsStandardCurrentTimestampFunction()

Overrides org.hibernate.dialect.Dialect.supportsStandardCurrentTimestampFunction.

Does this dialect have an ANSI SQL current_timestamp function?
public String
timestampaddPattern(TemporalUnit
The unit to add to the temporal
unit
,
TemporalType
The type of the temporal
temporalType
,
IntervalType
The type of interval to add or null if it's not a native interval
intervalType
)

Overrides org.hibernate.dialect.Dialect.timestampaddPattern.

Obtain a pattern for the SQL equivalent to a timestampadd() function call.
public String
timestampdiffPattern(TemporalUnit
the first argument
unit
,
TemporalType
true if the first argument is a timestamp, false if a date
fromTemporalType
,
TemporalType
true if the second argument is
toTemporalType
)

Overrides org.hibernate.dialect.Dialect.timestampdiffPattern.

Obtain a pattern for the SQL equivalent to a timestampdiff() function call.
public String
translateExtractField(TemporalUnit unit)

Overrides org.hibernate.dialect.Dialect.translateExtractField.

Return the name used to identify the given field as an argument to the extract() function, or of this dialect's equivalent function.
Inherited from org.hibernate.dialect.AbstractTransactSQLDialect:
appendBinaryLiteralappendLockHintapplyLocksToSqlcolumnTypedoesReadCommittedCauseWritersToBlockReadersdoesRepeatableReadCauseReadersToBlockWritersgetAddColumnStringgetCurrentTimestampSelectStringgetDefaultStatementBatchSizegetFallbackSqmInsertStrategygetFallbackSqmMutationStrategygetForUpdateStringgetNullOrderinggetPreferredSqlTypeCodeForBooleangetResultSetgetSelectGUIDStringgetSupportedTemporaryTableKindgetTemporaryTableAfterUseActiongetTemporaryTableBeforeUseActiongetTemporaryTableCreateCommandgetWriteRowLockStrategyisCurrentTimestampSelectStringCallablequalifyIndexNameregisterResultSetOutParameterreplaceLtrimRtrimreplaceLtrimRtrimrequiresCastForConcatenatingNonStringssupportsCurrentTimestampSelectionsupportsExistsInSelectsupportsPartitionBysupportsTupleDistinctCountstrimPattern

Field Detail

driverKindback to summary
private final SybaseDriverKind driverKind
IN_LIST_SIZE_LIMITback to summary
private static final int IN_LIST_SIZE_LIMIT
jtdsDriverback to summary
protected final boolean jtdsDriver

Deprecated

for removal.

Annotations
@Deprecated
forRemoval:true
MINIMUM_VERSIONback to summary
private static final DatabaseVersion MINIMUM_VERSION
PARAM_COUNT_LIMITback to summary
private static final int PARAM_COUNT_LIMIT
uniqueDelegateback to summary
private final UniqueDelegate uniqueDelegate

Constructor Detail

SybaseDialectback to summary
public SybaseDialect()
SybaseDialectback to summary
public SybaseDialect(DatabaseVersion version)
SybaseDialectback to summary
public SybaseDialect(DialectResolutionInfo info)

Method Detail

appendDatetimeFormatback to summary
public void appendDatetimeFormat(SqlAppender appender, String format)

Overrides org.hibernate.dialect.Dialect.appendDatetimeFormat.

Doc from org.hibernate.dialect.Dialect.appendDatetimeFormat.

Translate the given datetime format string from the pattern language defined by Java's java.time.format.DateTimeFormatter to whatever pattern language is understood by the native datetime formatting function for this database (often the to_char() function).

Since it's never possible to translate every pattern letter sequences understood by DateTimeFormatter, only the following subset of pattern letters is accepted by Hibernate:

  • G: era
  • y: year of era
  • Y: year of week-based year
  • M: month of year
  • w: week of week-based year (ISO week number)
  • W: week of month
  • E: day of week (name)
  • e: day of week (number)
  • d: day of month
  • D: day of year
  • a: AM/PM
  • H: hour of day (24 hour time)
  • h: hour of AM/PM (12 hour time)
  • m: minutes
  • s: seconds
  • z,Z,x: timezone offset

In addition, punctuation characters and single-quoted literal strings are accepted.

Appends a pattern accepted by the function that formats dates and times in this dialect to a SQL fragment that is being constructed.

Annotations
@Override
appendDateTimeLiteralback to summary
public void appendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone)

Overrides org.hibernate.dialect.Dialect.appendDateTimeLiteral.

Doc from org.hibernate.dialect.Dialect.appendDateTimeLiteral.

Append a datetime literal representing the given java.time value to the given SqlAppender.

Annotations
@Override
appendDateTimeLiteralback to summary
public void appendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone)

Overrides org.hibernate.dialect.Dialect.appendDateTimeLiteral.

Doc from org.hibernate.dialect.Dialect.appendDateTimeLiteral.

Append a datetime literal representing the given Date value to the given SqlAppender.

Annotations
@Override
appendDateTimeLiteralback to summary
public void appendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone)

Overrides org.hibernate.dialect.Dialect.appendDateTimeLiteral.

Doc from org.hibernate.dialect.Dialect.appendDateTimeLiteral.

Append a datetime literal representing the given Calendar value to the given SqlAppender.

Annotations
@Override
buildIdentifierHelperback to summary
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException

Overrides org.hibernate.dialect.Dialect.buildIdentifierHelper.

Doc from org.hibernate.dialect.Dialect.buildIdentifierHelper.

The IdentifierHelper indicated by this dialect for handling identifier conversions. Returning null is allowed and indicates that Hibernate should fall back to building a "standard" helper. In the fallback path, any changes made to the IdentifierHelperBuilder during this call will still be incorporated into the built IdentifierHelper.

The incoming builder will have the following set:

By default, Hibernate will do the following:

Parameters
builder:IdentifierHelperBuilder

A partially-configured IdentifierHelperBuilder.

dbMetaData:DatabaseMetaData

Access to the metadata returned from the driver if needed and if available

Warning

it may be null.

Returns:IdentifierHelper

The IdentifierHelper instance to use, or null to indicate Hibernate should use its fallback path

Annotations
@Override
Exceptions
SQLException:
Accessing the DatabaseMetaData can throw it. Just rethrow and Hibernate will handle it.
canCreateSchemaback to summary
public boolean canCreateSchema()

Overrides org.hibernate.dialect.Dialect.canCreateSchema.

Doc from org.hibernate.dialect.Dialect.canCreateSchema.

Does this dialect support creating and dropping schema?

Returns:boolean

True if the dialect supports schema creation; false otherwise.

Annotations
@Override
castPatternback to summary
public String castPattern(CastType from, CastType to)

Overrides org.hibernate.dialect.Dialect.castPattern.

Doc from org.hibernate.dialect.Dialect.castPattern.

Obtain a pattern for the SQL equivalent to a cast() function call. The resulting pattern must contain ?1 and ?2 placeholders for the arguments.

Parameters
from:CastType

a CastType indicating the type of the value argument

to:CastType

a CastType indicating the type the value argument is cast to

Annotations
@Override
contributeTypesback to summary
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)

Overrides org.hibernate.dialect.Dialect.contributeTypes.

Doc from org.hibernate.dialect.Dialect.contributeTypes.

A callback which allows the Dialect to contribute types.

Parameters
typeContributions:TypeContributions

Callback to contribute the types

serviceRegistry:ServiceRegistry

The service registry

Annotations
@Override
extractPatternback to summary
public String extractPattern(TemporalUnit unit)

Overrides org.hibernate.dialect.Dialect.extractPattern.

Doc from org.hibernate.dialect.Dialect.extractPattern.

Obtain a pattern for the SQL equivalent to an extract() function call. The resulting pattern must contain ?1 and ?2 placeholders for the arguments.

This method does not need to handle TemporalUnit#NANOSECOND, TemporalUnit#NATIVE, TemporalUnit#OFFSET, TemporalUnit#DATE, TemporalUnit#TIME, TemporalUnit#WEEK_OF_YEAR, or TemporalUnit#WEEK_OF_MONTH, which are already desugared by ExtractFunction.

Parameters
unit:TemporalUnit

the first argument

Annotations
@Override
getAlterColumnTypeStringback to summary
public String getAlterColumnTypeString(String columnName, String columnType, String columnDefinition)

Overrides org.hibernate.dialect.Dialect.getAlterColumnTypeString.

Doc from org.hibernate.dialect.Dialect.getAlterColumnTypeString.

The fragment of an alter table command which modifies a column type, or null if column types cannot be modified. Often alter column col_name set data type col_type.

Parameters
columnName:String

the name of the column

columnType:String

the new type of the column

columnDefinition:String

the full column definition

Returns:String

a fragment to be appended to alter table

Annotations
@Override
getCallableStatementSupportback to summary
public CallableStatementSupport getCallableStatementSupport()

Overrides org.hibernate.dialect.Dialect.getCallableStatementSupport.

Doc from org.hibernate.dialect.Dialect.getCallableStatementSupport.

The CallableStatementSupport for this database. Does this database support returning cursors?

Annotations
@Override
getCurrentSchemaCommandback to summary
public String getCurrentSchemaCommand()

Overrides org.hibernate.dialect.Dialect.getCurrentSchemaCommand.

Doc from org.hibernate.dialect.Dialect.getCurrentSchemaCommand.

Get the SQL command used to retrieve the current schema name.

Works in conjunction with getSchemaNameResolver(), unless the resulting SchemaNameResolver does not need this information. For example, a custom implementation might make use of the Java 1.7 Connection#getSchema() method.

Returns:String

The current schema retrieval SQL

Annotations
@Override
getDriverKindback to summary
public SybaseDriverKind getDriverKind()
getIdentityColumnSupportback to summary
public IdentityColumnSupport getIdentityColumnSupport()

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.getIdentityColumnSupport.

Doc from org.hibernate.dialect.Dialect.getIdentityColumnSupport.

Get the appropriate IdentityColumnSupport for this dialect.

Returns:IdentityColumnSupport

the IdentityColumnSupport

Annotations
@Override
getInExpressionCountLimitback to summary
public int getInExpressionCountLimit()

Overrides org.hibernate.dialect.Dialect.getInExpressionCountLimit.

Doc from org.hibernate.dialect.Dialect.getInExpressionCountLimit.

Return the limit that the underlying database places on the number of elements in an IN predicate. If the database defines no such limits, simply return zero or a number smaller than zero.

Returns:int

The limit, or a non-positive integer to indicate no limit.

Annotations
@Override
getMaxIdentifierLengthback to summary
public int getMaxIdentifierLength()

Overrides org.hibernate.dialect.Dialect.getMaxIdentifierLength.

Doc from org.hibernate.dialect.Dialect.getMaxIdentifierLength.

What is the maximum identifier length supported by this dialect?

Returns:int

The maximum length.

Annotations
@Override
getMinimumSupportedVersionback to summary
protected DatabaseVersion getMinimumSupportedVersion()

Overrides org.hibernate.dialect.Dialect.getMinimumSupportedVersion.

Doc from org.hibernate.dialect.Dialect.getMinimumSupportedVersion.

Get the version of the SQL dialect that is the minimum supported by this implementation.

Annotations
@Override
getNameQualifierSupportback to summary
public NameQualifierSupport getNameQualifierSupport()

Overrides org.hibernate.dialect.Dialect.getNameQualifierSupport.

Doc from org.hibernate.dialect.Dialect.getNameQualifierSupport.

The support for qualified identifiers.

By default, decide based on DatabaseMetaData.

Returns:NameQualifierSupport

The NameQualifierSupport, or null to use DatabaseMetaData.

Annotations
@Override
getNationalizationSupportback to summary
public NationalizationSupport getNationalizationSupport()

Overrides org.hibernate.dialect.Dialect.getNationalizationSupport.

Doc from org.hibernate.dialect.Dialect.getNationalizationSupport.

Determines whether this database requires the use of explicitly nationalized character (Unicode) data types.

That is, whether the use of Types#NCHAR, Types#NVARCHAR, and Types#NCLOB is required for nationalized character data.

Annotations
@Override
getNullColumnStringback to summary
public String getNullColumnString()

Overrides org.hibernate.dialect.Dialect.getNullColumnString.

Doc from org.hibernate.dialect.Dialect.getNullColumnString.

The keyword used to specify a nullable column, usually "", but sometimes " null".

Annotations
@Override
getParameterCountLimitback to summary
public int getParameterCountLimit()

Overrides org.hibernate.dialect.Dialect.getParameterCountLimit.

Doc from org.hibernate.dialect.Dialect.getParameterCountLimit.

Return the limit that the underlying database places on the number of parameters that can be defined for a PreparedStatement. If the database defines no such limits, simply return zero or a number smaller than zero. By default, Dialect returns the same value as getInExpressionCountLimit().

Returns:int

The limit, or a non-positive integer to indicate no limit.

Annotations
@Override
getSqlAstTranslatorFactoryback to summary
public SqlAstTranslatorFactory getSqlAstTranslatorFactory()

Overrides org.hibernate.dialect.Dialect.getSqlAstTranslatorFactory.

Doc from org.hibernate.dialect.Dialect.getSqlAstTranslatorFactory.

Return a SqlAstTranslatorFactory specific to this dialect, or null to use the standard translator.

Annotations
@Override
getSqmTranslatorFactoryback to summary
public SqmTranslatorFactory getSqmTranslatorFactory()

Overrides org.hibernate.dialect.Dialect.getSqmTranslatorFactory.

Doc from org.hibernate.dialect.Dialect.getSqmTranslatorFactory.

Return a SqmTranslatorFactory specific to this dialect, or null to use the standard translator.

Note that SessionFactoryOptions#getCustomSqmTranslatorFactory() has higher precedence since it comes directly from the user config.

Annotations
@Override
getUniqueDelegateback to summary
public UniqueDelegate getUniqueDelegate()

Overrides org.hibernate.dialect.Dialect.getUniqueDelegate.

Doc from org.hibernate.dialect.Dialect.getUniqueDelegate.

Get the UniqueDelegate supported by this dialect

Returns:UniqueDelegate

The UniqueDelegate

Annotations
@Override
initializeFunctionRegistryback to summary
public void initializeFunctionRegistry(FunctionContributions functionContributions)

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.initializeFunctionRegistry.

Doc from org.hibernate.dialect.Dialect.initializeFunctionRegistry.

Initialize the given registry with any dialect-specific functions.

Support for certain SQL functions is required, and if the database does not support a required function, then the dialect must define a way to emulate it.

These required functions include the functions defined by the JPA query language specification:

  • avg(arg) - aggregate function
  • count([distinct ]arg) - aggregate function
  • max(arg) - aggregate function
  • min(arg) - aggregate function
  • sum(arg) - aggregate function
  • coalesce(arg0, arg1, ...)
  • nullif(arg0, arg1)
  • lower(arg)
  • upper(arg)
  • length(arg)
  • concat(arg0, arg1, ...)
  • locate(pattern, string[, start])
  • substring(string, start[, length])
  • trim([[spec ][character ]from] string)
  • abs(arg)
  • mod(arg0, arg1)
  • sqrt(arg)
  • current date
  • current time
  • current timestamp
Along with an additional set of functions defined by ANSI SQL:
  • any(arg) - aggregate function
  • every(arg) - aggregate function
  • var_samp(arg) - aggregate function
  • var_pop(arg) - aggregate function
  • stddev_samp(arg) - aggregate function
  • stddev_pop(arg) - aggregate function
  • cast(arg as Type)
  • extract(field from arg)
  • ln(arg)
  • exp(arg)
  • power(arg0, arg1)
  • floor(arg)
  • ceiling(arg)
  • position(pattern in string)
  • substring(string from start[ for length])
  • overlay(string placing replacement from start[ for length])
And the following functions for working with java.time types:
  • local date
  • local time
  • local datetime
  • offset datetime
  • instant
And a number of additional "standard" functions:
  • left(string, length)
  • right(string, length)
  • replace(string, pattern, replacement)
  • pad(string with length spec[ character])
  • repeat(string, times)
  • pi
  • log10(arg)
  • log(base, arg)
  • sign(arg)
  • sin(arg)
  • cos(arg)
  • tan(arg)
  • asin(arg)
  • acos(arg)
  • atan(arg)
  • atan2(arg0, arg1)
  • round(arg0[, arg1])
  • truncate(arg0[, arg1])
  • sinh(arg)
  • tanh(arg)
  • cosh(arg)
  • least(arg0, arg1, ...)
  • greatest(arg0, arg1, ...)
  • degrees(arg)
  • radians(arg)
  • format(datetime as pattern)
  • collate(string as collation)
  • str(arg) - synonym of cast(a as String)
  • ifnull(arg0, arg1) - synonym of coalesce(a, b)
Finally, the following functions are defined as abbreviations for extract(), and desugared by the parser:
  • second(arg) - synonym of extract(second from a)
  • minute(arg) - synonym of extract(minute from a)
  • hour(arg) - synonym of extract(hour from a)
  • day(arg) - synonym of extract(day from a)
  • month(arg) - synonym of extract(month from a)
  • year(arg) - synonym of extract(year from a)
Note that according to this definition, the second() function returns a floating point value, contrary to the integer type returned by the native function with this name on many databases. Thus, we don't just naively map these HQL functions to the native SQL functions with the same names.
Annotations
@Override
resolveSqlTypeDescriptorback to summary
public JdbcType resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry)

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.resolveSqlTypeDescriptor.

Doc from org.hibernate.dialect.Dialect.resolveSqlTypeDescriptor.

Assigns an appropriate JdbcType to a column of a JDBC result set based on the column type name, JDBC type code, precision, and scale.

Parameters
columnTypeName:String

the column type name

jdbcTypeCode:int

the type code

precision:int

the precision or 0

scale:int

the scale or 0

Returns:JdbcType

an appropriate instance of JdbcType

Annotations
@Override
supportsAlterColumnTypeback to summary
public boolean supportsAlterColumnType()

Overrides org.hibernate.dialect.Dialect.supportsAlterColumnType.

Doc from org.hibernate.dialect.Dialect.supportsAlterColumnType.

Does this dialect support modifying the type of an existing column?

Annotations
@Override
supportsFractionalTimestampArithmeticback to summary
public boolean supportsFractionalTimestampArithmetic()

Overrides org.hibernate.dialect.Dialect.supportsFractionalTimestampArithmetic.

Doc from org.hibernate.dialect.Dialect.supportsFractionalTimestampArithmetic.

Whether the database supports adding a fractional interval to a timestamp, for example timestamp + 0.5 second.

Annotations
@Override
supportsNamedParametersback to summary
public boolean supportsNamedParameters(DatabaseMetaData databaseMetaData) throws SQLException

Overrides org.hibernate.dialect.Dialect.supportsNamedParameters.

Doc from org.hibernate.dialect.Dialect.supportsNamedParameters.

Override DatabaseMetaData#supportsNamedParameters().

Annotations
@Override
Exceptions
SQLException:
Accessing the DatabaseMetaData cause an exception. Just rethrow and Hibernate will handle it.
supportsNullPrecedenceback to summary
public boolean supportsNullPrecedence()

Overrides org.hibernate.dialect.Dialect.supportsNullPrecedence.

Doc from org.hibernate.dialect.Dialect.supportsNullPrecedence.

Does this dialect support nulls first and nulls last?

Annotations
@Override
supportsStandardCurrentTimestampFunctionback to summary
public boolean supportsStandardCurrentTimestampFunction()

Overrides org.hibernate.dialect.Dialect.supportsStandardCurrentTimestampFunction.

Doc from org.hibernate.dialect.Dialect.supportsStandardCurrentTimestampFunction.

Does this dialect have an ANSI SQL current_timestamp function?

Annotations
@Override
timestampaddPatternback to summary
public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType)

Overrides org.hibernate.dialect.Dialect.timestampaddPattern.

Doc from org.hibernate.dialect.Dialect.timestampaddPattern.

Obtain a pattern for the SQL equivalent to a timestampadd() function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.

Parameters
unit:TemporalUnit

The unit to add to the temporal

temporalType:TemporalType

The type of the temporal

intervalType:IntervalType

The type of interval to add or null if it's not a native interval

Annotations
@Override
timestampdiffPatternback to summary
public String timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType)

Overrides org.hibernate.dialect.Dialect.timestampdiffPattern.

Doc from org.hibernate.dialect.Dialect.timestampdiffPattern.

Obtain a pattern for the SQL equivalent to a timestampdiff() function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.

Parameters
unit:TemporalUnit

the first argument

fromTemporalType:TemporalType

true if the first argument is a timestamp, false if a date

toTemporalType:TemporalType

true if the second argument is

Annotations
@Override
translateExtractFieldback to summary
public String translateExtractField(TemporalUnit unit)

Overrides org.hibernate.dialect.Dialect.translateExtractField.

Doc from org.hibernate.dialect.Dialect.translateExtractField.

Return the name used to identify the given field as an argument to the extract() function, or of this dialect's equivalent function.

This method does not need to handle TemporalUnit#NANOSECOND, TemporalUnit#NATIVE, TemporalUnit#OFFSET, TemporalUnit#DATE, TemporalUnit#TIME, TemporalUnit#WEEK_OF_YEAR, nor TemporalUnit#WEEK_OF_MONTH, which are already desugared by ExtractFunction.

Annotations
@Override