Class SybaseDialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.AbstractTransactSQLDialect
-
- org.hibernate.dialect.SybaseDialect
-
- All Implemented Interfaces:
FunctionContributor
,TypeContributor
,ConversionContext
- Direct Known Subclasses:
SybaseASEDialect
public class SybaseDialect extends AbstractTransactSQLDialect
Superclass for all Sybase dialects.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.dialect.Dialect
Dialect.SizeStrategy, Dialect.SizeStrategyImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
jtdsDriver
Deprecated, for removal: This API element is subject to removal in a future version.-
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, LEGACY_LOB_MERGE_STRATEGY, LOG_BASE2OF10, NEW_LOCATOR_LOB_MERGE_STRATEGY, QUOTE, STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description SybaseDialect()
SybaseDialect(DatabaseVersion version)
SybaseDialect(DialectResolutionInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendDatetimeFormat(SqlAppender appender, String format)
Translate the given datetime format string from the pattern language defined by Java'sDateTimeFormatter
to whatever pattern language is understood by the native datetime formatting function for this database (often theto_char()
function).void
appendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone)
Append a datetime literal representing the givenjava.time
value to the givenSqlAppender
.void
appendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone)
Append a datetime literal representing the givenCalendar
value to the givenSqlAppender
.void
appendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone)
Append a datetime literal representing the givenDate
value to the givenSqlAppender
.IdentifierHelper
buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData)
TheIdentifierHelper
indicated by this dialect for handling identifier conversions.boolean
canCreateSchema()
Does this dialect support creating and dropping schema?String
castPattern(CastType from, CastType to)
Obtain a pattern for the SQL equivalent to acast()
function call.void
contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
A callback which allows theDialect
to contribute types.String
extractPattern(TemporalUnit unit)
Obtain a pattern for the SQL equivalent to anextract()
function call.String
getAlterColumnTypeString(String columnName, String columnType, String columnDefinition)
The fragment of analter table
command which modifies a column type, or null if column types cannot be modified.CallableStatementSupport
getCallableStatementSupport()
TheCallableStatementSupport
for this database.String
getCurrentSchemaCommand()
Get the SQL command used to retrieve the current schema name.DmlTargetColumnQualifierSupport
getDmlTargetColumnQualifierSupport()
Get the minimumDmlTargetColumnQualifierSupport
required by this dialect.SybaseDriverKind
getDriverKind()
IdentityColumnSupport
getIdentityColumnSupport()
Get the appropriateIdentityColumnSupport
for this dialect.int
getInExpressionCountLimit()
Return the limit that the underlying database places on the number of elements in anIN
predicate.int
getMaxIdentifierLength()
What is the maximum identifier length supported by this dialect?protected DatabaseVersion
getMinimumSupportedVersion()
Get the version of the SQL dialect that is the minimum supported by this implementation.NameQualifierSupport
getNameQualifierSupport()
NationalizationSupport
getNationalizationSupport()
Determines whether this database requires the use of explicitly nationalized character (Unicode) data types.String
getNullColumnString()
The keyword used to specify a nullable column, usually""
, but sometimes" null"
.int
getParameterCountLimit()
Return the limit that the underlying database places on the number of parameters that can be defined for a PreparedStatement.SqlAstTranslatorFactory
getSqlAstTranslatorFactory()
SqmTranslatorFactory
getSqmTranslatorFactory()
UniqueDelegate
getUniqueDelegate()
Get theUniqueDelegate
supported by this dialectvoid
initializeFunctionRegistry(FunctionContributions functionContributions)
Initialize the given registry with any dialect-specific functions.JdbcType
resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry)
Assigns an appropriateJdbcType
to a column of a JDBC result set based on the column type name, JDBC type code, precision, and scale.int
resolveSqlTypeLength(String columnTypeName, int jdbcTypeCode, int precision, int scale, int displaySize)
Determine the length/precision of a column based on information in the JDBCResultSetMetaData
.boolean
supportsAlterColumnType()
Does this dialect support modifying the type of an existing column?boolean
supportsFractionalTimestampArithmetic()
Whether the database supports adding a fractional interval to a timestamp, for exampletimestamp + 0.5 second
.boolean
supportsFromClauseInUpdate()
Does this dialect support thefrom
clause for update statements?boolean
supportsNamedParameters(DatabaseMetaData databaseMetaData)
boolean
supportsNullPrecedence()
Does this dialect supportnulls first
andnulls last
?boolean
supportsStandardCurrentTimestampFunction()
Does this dialect have an ANSI SQLcurrent_timestamp
function?String
timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType)
Obtain a pattern for the SQL equivalent to atimestampadd()
function call.String
timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType)
Obtain a pattern for the SQL equivalent to atimestampdiff()
function call.String
translateExtractField(TemporalUnit unit)
Return the name used to identify the given field as an argument to theextract()
function, or of this dialect's equivalent function.-
Methods inherited from class org.hibernate.dialect.AbstractTransactSQLDialect
appendBinaryLiteral, appendLockHint, applyLocksToSql, columnType, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, getAddColumnString, getCurrentTimestampSelectString, getDefaultStatementBatchSize, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getForUpdateString, getNullOrdering, getPreferredSqlTypeCodeForBoolean, getResultSet, getSelectGUIDString, getSupportedTemporaryTableKind, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getWriteRowLockStrategy, isCurrentTimestampSelectStringCallable, qualifyIndexName, registerResultSetOutParameter, replaceLtrimRtrim, replaceLtrimRtrim, requiresCastForConcatenatingNonStrings, supportsCurrentTimestampSelection, supportsExistsInSelect, supportsPartitionBy, supportsTupleDistinctCounts, trimPattern
-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendArrayLiteral, appendBooleanValueString, appendIntervalLiteral, appendLiteral, appendUUIDLiteral, augmentPhysicalTableTypes, augmentRecognizedTableTypes, buildSQLExceptionConversionDelegate, canBatchTruncate, canCreateCatalog, canDisableConstraints, castType, checkVersion, closeQuote, contribute, contributeFunctions, createOptionalTableUpdateOperation, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestamp, currentTimestampWithTimeZone, defaultScrollMode, doesRoundTemporalOnOverflow, dropConstraints, equivalentTypes, escapeComment, forceLobAsLastValue, generatedAs, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAggregateSupport, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getCascadeConstraintsString, getCaseInsensitiveLike, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateEnumTypeCommand, getCreateEnumTypeCommand, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCreateUserDefinedTypeKindString, getCrossReferenceParentTableFilter, getDefaultDecimalPrecision, getDefaultIntervalSecondScale, getDefaultLobLength, getDefaultNonContextualLobCreation, getDefaultProperties, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintsStatement, getDisableConstraintStatement, getDoublePrecision, getDropCatalogCommand, getDropEnumTypeCommand, getDropEnumTypeCommand, getDropForeignKeyString, getDropSchemaCommand, getDropTableString, getDropUniqueKeyString, getEnableConstraintsStatement, getEnableConstraintStatement, getEnumTypeDeclaration, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getFloatPrecision, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFractionalSecondPrecisionInNanos, getFunctionalDependencyAnalysisSupport, getGroupBySelectItemReferenceStrategy, getHqlTranslator, getIndexExporter, getKeywords, getLimitHandler, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxAliasLength, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarbinaryLength, getMaxVarcharCapacity, getMaxVarcharLength, getMultiKeyLoadSizingStrategy, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNoColumnsInsertString, getNullColumnString, getPreferredSqlTypeCodeForArray, getQueryHintString, getQueryHintString, getQuerySequencesString, getReadLockString, getReadLockString, getReadRowLockStrategy, getResultSet, getResultSet, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSequenceInformationExtractor, getSequenceSupport, getSizeStrategy, getTableCleaner, getTableComment, getTableExporter, getTableMigrator, getTableTypeString, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableDropCommand, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTimeZoneSupport, getTruncateTableStatement, getTruncateTableStatements, getUniqueKeyExporter, getUserDefinedTypeComment, getUserDefinedTypeExporter, getVersion, getViolatedConstraintNameExtractor, getWriteLockString, getWriteLockString, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, initDefaultProperties, inlineLiteral, isAnsiNullOn, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLob, isLockTimeoutParameterized, openQuote, ordinal, prependComment, quote, quoteCollation, registerColumnTypes, registerDefaultKeywords, registerKeyword, registerKeywords, registerResultSetOutParameter, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, rowId, rowIdSqlType, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBitType, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsConflictClauseForInsertCTE, supportsDistinctFromPredicate, supportsExpectedLobUsagePattern, supportsFetchClause, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsIfExistsBeforeTypeName, supportsInsertReturning, supportsInsertReturningGeneratedKeys, supportsInsertReturningRowId, supportsIsTrue, supportsJdbcConnectionLobCreation, supportsLateral, supportsLobValueChangePropagation, supportsLockTimeouts, supportsMaterializedLobAccess, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNoWait, supportsOffsetInSubquery, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPredicateAsExpression, supportsRecursiveCTE, supportsRefCursors, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsSkipLocked, supportsStandardArrays, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUpdateReturning, supportsValuesList, supportsValuesListForInsert, supportsWait, supportsWindowFunctions, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, trimPattern, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters, useCrossReferenceForeignKeys, useFollowOnLocking, useInputStreamToInsertBlob, useMaterializedLobWhenCapacityExceeded
-
-
-
-
Field Detail
-
jtdsDriver
@Deprecated(forRemoval=true) protected final boolean jtdsDriver
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Detail
-
SybaseDialect
public SybaseDialect()
-
SybaseDialect
public SybaseDialect(DatabaseVersion version)
-
SybaseDialect
public SybaseDialect(DialectResolutionInfo info)
-
-
Method Detail
-
getMinimumSupportedVersion
protected DatabaseVersion getMinimumSupportedVersion()
Description copied from class:Dialect
Get the version of the SQL dialect that is the minimum supported by this implementation.- Overrides:
getMinimumSupportedVersion
in classDialect
-
getDriverKind
public SybaseDriverKind getDriverKind()
-
resolveSqlTypeDescriptor
public JdbcType resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry)
Description copied from class:Dialect
Assigns an appropriateJdbcType
to a column of a JDBC result set based on the column type name, JDBC type code, precision, and scale.- Overrides:
resolveSqlTypeDescriptor
in classAbstractTransactSQLDialect
- Parameters:
columnTypeName
- the column type namejdbcTypeCode
- thetype code
precision
- the precision or 0scale
- the scale or 0- Returns:
- an appropriate instance of
JdbcType
-
resolveSqlTypeLength
public int resolveSqlTypeLength(String columnTypeName, int jdbcTypeCode, int precision, int scale, int displaySize)
Description copied from class:Dialect
Determine the length/precision of a column based on information in the JDBCResultSetMetaData
. Note that what JDBC reports as a "precision" might actually be the column length.- Overrides:
resolveSqlTypeLength
in classDialect
- Parameters:
columnTypeName
- the name of the column typejdbcTypeCode
- the JDBC type code of the column typeprecision
- the (numeric) precision or (character) length of the columnscale
- the scale of a numeric columndisplaySize
- the display size of the column- Returns:
- the precision or length of the column
-
getSqmTranslatorFactory
public SqmTranslatorFactory getSqmTranslatorFactory()
Description copied from class:Dialect
Return aSqmTranslatorFactory
specific to this dialect, ornull
to use the standard translator.Note that
QueryEngineOptions.getCustomSqmTranslatorFactory()
has higher precedence since it comes directly from the user config.- Overrides:
getSqmTranslatorFactory
in classDialect
- See Also:
StandardSqmTranslator
,QueryEngine.getSqmTranslatorFactory()
-
getSqlAstTranslatorFactory
public SqlAstTranslatorFactory getSqlAstTranslatorFactory()
Description copied from class:Dialect
- Overrides:
getSqlAstTranslatorFactory
in classDialect
- See Also:
StandardSqlAstTranslatorFactory
,JdbcEnvironment.getSqlAstTranslatorFactory()
-
supportsNullPrecedence
public boolean supportsNullPrecedence()
Description copied from class:Dialect
Does this dialect supportnulls first
andnulls last
?- Overrides:
supportsNullPrecedence
in classDialect
-
getInExpressionCountLimit
public int getInExpressionCountLimit()
Description copied from class:Dialect
Return the limit that the underlying database places on the number of elements in anIN
predicate. If the database defines no such limits, simply return zero or a number smaller than zero.- Overrides:
getInExpressionCountLimit
in classDialect
- Returns:
- The limit, or a non-positive integer to indicate no limit.
-
getParameterCountLimit
public int getParameterCountLimit()
Description copied from class:Dialect
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 asDialect.getInExpressionCountLimit()
.- Overrides:
getParameterCountLimit
in classDialect
- Returns:
- The limit, or a non-positive integer to indicate no limit.
-
contributeTypes
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
Description copied from class:Dialect
A callback which allows theDialect
to contribute types.- Overrides:
contributeTypes
in classDialect
- Parameters:
typeContributions
- Callback to contribute the typesserviceRegistry
- The service registry
-
getNationalizationSupport
public NationalizationSupport getNationalizationSupport()
Description copied from class:Dialect
Determines whether this database requires the use of explicitly nationalized character (Unicode) data types.That is, whether the use of
Types.NCHAR
,Types.NVARCHAR
, andTypes.NCLOB
is required for nationalized character data.- Overrides:
getNationalizationSupport
in classDialect
-
initializeFunctionRegistry
public void initializeFunctionRegistry(FunctionContributions functionContributions)
Description copied from class:Dialect
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
-
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])
java.time
types:-
local date
-
local time
-
local datetime
-
offset datetime
-
instant
-
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)
-
bitand(arg1, arg1)
-
bitor(arg1, arg1)
-
bitxor(arg1, arg1)
-
format(datetime as pattern)
-
collate(string as collation)
-
str(arg)
- synonym ofcast(a as String)
-
ifnull(arg0, arg1)
- synonym ofcoalesce(a, b)
extract()
, and desugared by the parser:-
second(arg)
- synonym ofextract(second from a)
-
minute(arg)
- synonym ofextract(minute from a)
-
hour(arg)
- synonym ofextract(hour from a)
-
day(arg)
- synonym ofextract(day from a)
-
month(arg)
- synonym ofextract(month from a)
-
year(arg)
- synonym ofextract(year from a)
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.- Overrides:
initializeFunctionRegistry
in classAbstractTransactSQLDialect
-
-
getNullColumnString
public String getNullColumnString()
Description copied from class:Dialect
The keyword used to specify a nullable column, usually""
, but sometimes" null"
.- Overrides:
getNullColumnString
in classDialect
-
canCreateSchema
public boolean canCreateSchema()
Description copied from class:Dialect
Does this dialect support creating and dropping schema?- Overrides:
canCreateSchema
in classDialect
- Returns:
- True if the dialect supports schema creation; false otherwise.
-
getCurrentSchemaCommand
public String getCurrentSchemaCommand()
Description copied from class:Dialect
Get the SQL command used to retrieve the current schema name.Works in conjunction with
Dialect.getSchemaNameResolver()
, unless the resultingSchemaNameResolver
does not need this information. For example, a custom implementation might make use of the Java 1.7Connection.getSchema()
method.- Overrides:
getCurrentSchemaCommand
in classDialect
- Returns:
- The current schema retrieval SQL
-
getMaxIdentifierLength
public int getMaxIdentifierLength()
Description copied from class:Dialect
What is the maximum identifier length supported by this dialect?- Overrides:
getMaxIdentifierLength
in classDialect
- Returns:
- The maximum length.
-
castPattern
public String castPattern(CastType from, CastType to)
Description copied from class:Dialect
Obtain a pattern for the SQL equivalent to acast()
function call. The resulting pattern must contain ?1 and ?2 placeholders for the arguments.- Overrides:
castPattern
in classDialect
- Parameters:
from
- aCastType
indicating the type of the value argumentto
- aCastType
indicating the type the value argument is cast to
-
appendDateTimeLiteral
public void appendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone)
Description copied from class:Dialect
Append a datetime literal representing the givenjava.time
value to the givenSqlAppender
.- Overrides:
appendDateTimeLiteral
in classDialect
-
appendDateTimeLiteral
public void appendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone)
Description copied from class:Dialect
Append a datetime literal representing the givenDate
value to the givenSqlAppender
.- Overrides:
appendDateTimeLiteral
in classDialect
-
appendDateTimeLiteral
public void appendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone)
Description copied from class:Dialect
Append a datetime literal representing the givenCalendar
value to the givenSqlAppender
.- Overrides:
appendDateTimeLiteral
in classDialect
-
translateExtractField
public String translateExtractField(TemporalUnit unit)
Description copied from class:Dialect
Return the name used to identify the given field as an argument to theextract()
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
, norTemporalUnit.WEEK_OF_MONTH
, which are already desugared byExtractFunction
.- Overrides:
translateExtractField
in classDialect
-
extractPattern
public String extractPattern(TemporalUnit unit)
Description copied from class:Dialect
Obtain a pattern for the SQL equivalent to anextract()
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
, orTemporalUnit.WEEK_OF_MONTH
, which are already desugared byExtractFunction
.- Overrides:
extractPattern
in classDialect
- Parameters:
unit
- the first argument
-
supportsFractionalTimestampArithmetic
public boolean supportsFractionalTimestampArithmetic()
Description copied from class:Dialect
Whether the database supports adding a fractional interval to a timestamp, for exampletimestamp + 0.5 second
.- Overrides:
supportsFractionalTimestampArithmetic
in classDialect
-
timestampaddPattern
public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType)
Description copied from class:Dialect
Obtain a pattern for the SQL equivalent to atimestampadd()
function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.- Overrides:
timestampaddPattern
in classDialect
- Parameters:
unit
- The unit to add to the temporaltemporalType
- The type of the temporalintervalType
- The type of interval to add or null if it's not a native interval
-
timestampdiffPattern
public String timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType)
Description copied from class:Dialect
Obtain a pattern for the SQL equivalent to atimestampdiff()
function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.- Overrides:
timestampdiffPattern
in classDialect
- Parameters:
unit
- the first argumentfromTemporalType
- true if the first argument is a timestamp, false if a datetoTemporalType
- true if the second argument is
-
appendDatetimeFormat
public void appendDatetimeFormat(SqlAppender appender, String format)
Description copied from class:Dialect
Translate the given datetime format string from the pattern language defined by Java'sDateTimeFormatter
to whatever pattern language is understood by the native datetime formatting function for this database (often theto_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.
- Overrides:
appendDatetimeFormat
in classDialect
-
supportsStandardCurrentTimestampFunction
public boolean supportsStandardCurrentTimestampFunction()
Description copied from class:Dialect
Does this dialect have an ANSI SQLcurrent_timestamp
function?- Overrides:
supportsStandardCurrentTimestampFunction
in classDialect
-
buildIdentifierHelper
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException
Description copied from class:Dialect
TheIdentifierHelper
indicated by this dialect for handling identifier conversions. Returningnull
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:
IdentifierHelperBuilder.isGloballyQuoteIdentifiers()
IdentifierHelperBuilder.getUnquotedCaseStrategy()
- initialized to UPPERIdentifierHelperBuilder.getQuotedCaseStrategy()
- initialized to MIXED
By default, Hibernate will do the following:
- Call
IdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData)
- Call
IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData)
- Applies
AnsiSqlKeywords.sql2003()
as reserved words - Applies the {#link #sqlKeywords} collected here as reserved words
- Applies the Dialect's
NameQualifierSupport
, if it defines one
- Overrides:
buildIdentifierHelper
in classDialect
- Parameters:
builder
- A partially-configuredIdentifierHelperBuilder
.dbMetaData
- Access to the metadata returned from the driver if needed and if available. WARNING: it may benull
.- Returns:
- The
IdentifierHelper
instance to use, ornull
to indicate Hibernate should use its fallback path - Throws:
SQLException
- Accessing theDatabaseMetaData
can throw it. Just rethrow and Hibernate will handle it.- See Also:
Dialect.getNameQualifierSupport()
-
getNameQualifierSupport
public NameQualifierSupport getNameQualifierSupport()
Description copied from class:Dialect
The support for qualified identifiers.By default, decide based on
DatabaseMetaData
.- Overrides:
getNameQualifierSupport
in classDialect
- Returns:
- The
NameQualifierSupport
, or null to useDatabaseMetaData
.
-
getUniqueDelegate
public UniqueDelegate getUniqueDelegate()
Description copied from class:Dialect
Get theUniqueDelegate
supported by this dialect- Overrides:
getUniqueDelegate
in classDialect
- Returns:
- The UniqueDelegate
-
getCallableStatementSupport
public CallableStatementSupport getCallableStatementSupport()
Description copied from class:Dialect
TheCallableStatementSupport
for this database. Does this database support returning cursors?- Overrides:
getCallableStatementSupport
in classDialect
-
supportsNamedParameters
public boolean supportsNamedParameters(DatabaseMetaData databaseMetaData) throws SQLException
Description copied from class:Dialect
- Overrides:
supportsNamedParameters
in classDialect
- Throws:
SQLException
- Accessing theDatabaseMetaData
cause an exception. Just rethrow and Hibernate will handle it.
-
getAlterColumnTypeString
public String getAlterColumnTypeString(String columnName, String columnType, String columnDefinition)
Description copied from class:Dialect
The fragment of analter table
command which modifies a column type, or null if column types cannot be modified. Oftenalter column col_name set data type col_type
.- Overrides:
getAlterColumnTypeString
in classDialect
- Parameters:
columnName
- the name of the columncolumnType
- the new type of the columncolumnDefinition
- the full column definition- Returns:
- a fragment to be appended to
alter table
-
supportsAlterColumnType
public boolean supportsAlterColumnType()
Description copied from class:Dialect
Does this dialect support modifying the type of an existing column?- Overrides:
supportsAlterColumnType
in classDialect
-
getIdentityColumnSupport
public IdentityColumnSupport getIdentityColumnSupport()
Description copied from class:Dialect
Get the appropriateIdentityColumnSupport
for this dialect.- Overrides:
getIdentityColumnSupport
in classAbstractTransactSQLDialect
- Returns:
- the IdentityColumnSupport
-
getDmlTargetColumnQualifierSupport
public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport()
Description copied from class:Dialect
Get the minimumDmlTargetColumnQualifierSupport
required by this dialect.- Overrides:
getDmlTargetColumnQualifierSupport
in classDialect
- Returns:
- the column qualifier support required by this dialect
-
supportsFromClauseInUpdate
public boolean supportsFromClauseInUpdate()
Description copied from class:Dialect
Does this dialect support thefrom
clause for update statements?- Overrides:
supportsFromClauseInUpdate
in classDialect
- Returns:
true
iffrom
clause is supported
-
-