public class SybaseDialect extends AbstractTransactSQLDialect
Dialect.SizeStrategy, Dialect.SizeStrategyImpl
Modifier and Type | Field and Description |
---|---|
protected boolean |
jtdsDriver |
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, LEGACY_LOB_MERGE_STRATEGY, NEW_LOCATOR_LOB_MERGE_STRATEGY, NO_BATCH, QUOTE, STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY, TWO_SINGLE_QUOTES_REPLACEMENT
Constructor and Description |
---|
SybaseDialect() |
SybaseDialect(DialectResolutionInfo info) |
SybaseDialect(int version,
boolean jtdsDriver) |
Modifier and Type | Method and Description |
---|---|
IdentifierHelper |
buildIdentifierHelper(IdentifierHelperBuilder builder,
DatabaseMetaData dbMetaData)
Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.
|
boolean |
canCreateSchema()
Does this dialect support schema creation?
|
String |
castPattern(CastType from,
CastType to)
Obtain a pattern for the SQL equivalent to a
cast() function call. |
void |
contributeTypes(TypeContributions typeContributions,
ServiceRegistry serviceRegistry)
Allows the Dialect to contribute additional types
|
String |
extractPattern(TemporalUnit unit)
Obtain a pattern for the SQL equivalent to an
extract() function call. |
String |
getCurrentSchemaCommand()
Get the SQL command used to retrieve the current schema name.
|
int |
getInExpressionCountLimit()
Return the limit that the underlying database places on the number of elements in an
IN predicate. |
NationalizationSupport |
getNationalizationSupport() |
String |
getNullColumnString()
The keyword used to specify a nullable column.
|
SqlAstTranslatorFactory |
getSqlAstTranslatorFactory()
Return an SqlAstTranslatorFactory specific for the Dialect.
|
protected JdbcTypeDescriptor |
getSqlTypeDescriptorOverride(int sqlCode)
Returns the
JdbcTypeDescriptor that should be used to handle the given JDBC type code. |
SqmTranslatorFactory |
getSqmTranslatorFactory()
Return an SqmToSqlAstConverterFactory specific for the Dialect.
|
int |
getVersion() |
void |
initializeFunctionRegistry(QueryEngine queryEngine)
Initialize the given registry with any dialect-specific functions.
|
JdbcTypeDescriptor |
resolveSqlTypeDescriptor(int jdbcTypeCode,
int precision,
int scale,
JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) |
boolean |
supportsFractionalTimestampArithmetic()
Whether the database supports adding a fractional interval to a timestamp
e.g.
|
boolean |
supportsNullPrecedence() |
String |
timestampaddPattern(TemporalUnit unit,
TemporalType temporalType)
Obtain a pattern for the SQL equivalent to a
timestampadd() function call. |
String |
timestampdiffPattern(TemporalUnit unit,
TemporalType fromTemporalType,
TemporalType toTemporalType)
Obtain a pattern for the SQL equivalent to a
timestampdiff() function call. |
String |
translateDatetimeFormat(String format)
Translate the given datetime format string from
the pattern language defined by Java's
DateTimeFormatter to
whatever pattern language is understood by the
native datetime formatting function for this
database (often the to_char() function). |
String |
translateExtractField(TemporalUnit unit)
Return the name used to identify the given field
as an argument to the
extract() function,
or of this dialect's equivalent
function. |
String |
trimPattern(TrimSpec specification,
char character)
Obtain a pattern for the SQL equivalent to a
trim() function call. |
appendLockHint, applyLocksToSql, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, formatBinaryLiteral, getAddColumnString, getCurrentTimestampSelectString, getFallbackSqmMutationStrategy, getForUpdateString, getGroupByConstantRenderingStrategy, getIdentityColumnSupport, getNullOrdering, getPreferredSqlTypeCodeForBoolean, getResultSet, getSelectGUIDString, getWriteRowLockStrategy, isCurrentTimestampSelectStringCallable, qualifyIndexName, registerResultSetOutParameter, replaceLtrimRtrim, supportsCurrentTimestampSelection, supportsEmptyInList, supportsExistsInSelect, supportsPartitionBy, supportsTupleDistinctCounts, supportsTuplesInSubqueries
addSqlHintOrComment, appendLockHint, areStringComparisonsCaseInsensitive, augmentRecognizedTableTypes, binaryToDecimalPrecision, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConversionDelegate, buildSQLExceptionConverter, canCreateCatalog, closeQuote, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestamp, currentTimestampWithTimeZone, defaultScrollMode, dropConstraints, equivalentTypes, escapeComment, escapeLiteral, forceLimitUsage, forceLobAsLastValue, formatAsTimestamp, formatAsTimestamp, formatAsTimestamp, formatDateTimeLiteral, formatDateTimeLiteral, formatDateTimeLiteral, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getBooleanCheckCondition, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCrossJoinSeparator, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultDecimalPrecision, getDefaultLobLength, getDefaultProperties, getDefaultTimestampPrecision, getDialect, getDialect, getDoublePrecision, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropSequenceString, getDropSequenceStrings, getDropTableString, getEnumCheckCondition, getFloatPrecision, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFractionalSecondPrecisionInNanos, getFromDual, getGroupBySummarizationRenderingStrategy, getHibernateTypeName, getHibernateTypeName, getHqlTranslator, getIndexExporter, getKeywords, getLimitHandler, getLimitString, getLimitString, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxAliasLength, getNameQualifierSupport, getNativeIdentifierGeneratorClass, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNotExpression, getNullColumnString, getQueryHintString, getQueryHintString, getQuerySequencesString, getRawTypeName, getRawTypeName, getReadLockString, getReadLockString, getReadRowLockStrategy, getResultSet, getResultSet, getSchemaNameResolver, getSelectClauseNullString, getSelectSequenceNextValString, getSequenceExporter, getSequenceInformationExtractor, getSequenceNextValString, getSequenceNextValString, getSequenceSupport, getSizeStrategy, getTableAliasSeparator, getTableComment, getTableExporter, getTableTypeString, getTypeName, getTypeName, getTypeName, getTypeName, getUniqueDelegate, getUniqueKeyExporter, getViolatedConstraintNameExtractor, getWriteLockString, getWriteLockString, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, quote, registerColumnType, registerColumnType, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, remapSqlTypeDescriptor, renderOrderByElement, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, requiresFloatCastingOfIntegerDivision, requiresParensForTupleDistinctCounts, supportsBindAsCallableArgument, supportsBitType, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsExpectedLobUsagePattern, supportsFetchClause, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsJdbcConnectionLobCreation, supportsLimit, supportsLimitOffset, supportsLobValueChangePropagation, supportsLockTimeouts, supportsNamedParameters, supportsNationalizedTypes, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNotNullUnique, supportsNoWait, supportsOffsetInSubquery, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsRowValueConstructorSyntaxInInSubquery, supportsRowValueConstructorSyntaxInQuantifiedPredicates, supportsRowValueConstructorSyntaxInSet, supportsSelectAliasInGroupByClause, supportsSelectQueryWithoutFromClause, supportsSequences, supportsSkipLocked, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporalLiteralOffset, supportsTemporaryTables, supportsTimezoneTypes, supportsTruncateWithCast, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, supportsValuesListForInsert, supportsVariableLimit, supportsWait, supportsWindowFunctions, toBooleanValueString, toString, transformSelectString, translateDurationField, useFollowOnLocking, useInputStreamToInsertBlob, useMaxForLimit, wrapDateLiteral, wrapTimeLiteral, wrapTimestampLiteral
public SybaseDialect()
public SybaseDialect(DialectResolutionInfo info)
public SybaseDialect(int version, boolean jtdsDriver)
public JdbcTypeDescriptor resolveSqlTypeDescriptor(int jdbcTypeCode, int precision, int scale, JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry)
resolveSqlTypeDescriptor
in class AbstractTransactSQLDialect
public SqmTranslatorFactory getSqmTranslatorFactory()
Dialect
null
to use Hibernate's standard translator.
Note that QueryEngineOptions.getCustomSqmTranslatorFactory()
has higher
precedence as it comes directly from the user configgetSqmTranslatorFactory
in class Dialect
StandardSqmTranslator
,
QueryEngine.getSqmTranslatorFactory()
public SqlAstTranslatorFactory getSqlAstTranslatorFactory()
Dialect
null
to use Hibernate's standard translator.getSqlAstTranslatorFactory
in class Dialect
StandardSqlAstTranslatorFactory
,
JdbcEnvironment.getSqlAstTranslatorFactory()
public int getVersion()
getVersion
in class Dialect
public boolean supportsNullPrecedence()
supportsNullPrecedence
in class Dialect
public int getInExpressionCountLimit()
Dialect
IN
predicate.
If the database defines no such limits, simply return zero or less-than-zero.getInExpressionCountLimit
in class Dialect
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
Dialect
contributeTypes
in class Dialect
typeContributions
- Callback to contribute the typesserviceRegistry
- The service registrypublic NationalizationSupport getNationalizationSupport()
getNationalizationSupport
in class Dialect
protected JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode)
Dialect
JdbcTypeDescriptor
that should be used to handle the given JDBC type code. Returns
null
if there is no override.getSqlTypeDescriptorOverride
in class Dialect
sqlCode
- A Types
constant indicating the SQL column typeJdbcTypeDescriptor
to use as an override, or null
if there is no override.public void initializeFunctionRegistry(QueryEngine queryEngine)
Dialect
initializeFunctionRegistry
in class AbstractTransactSQLDialect
public String getNullColumnString()
Dialect
getNullColumnString
in class Dialect
public boolean canCreateSchema()
Dialect
canCreateSchema
in class Dialect
public String getCurrentSchemaCommand()
Dialect
Dialect.getSchemaNameResolver()
, unless the return from there does not need this
information. E.g., a custom impl might make use of the Java 1.7 addition of
the Connection.getSchema()
methodgetCurrentSchemaCommand
in class Dialect
public String castPattern(CastType from, CastType to)
Dialect
cast()
function call. The resulting
pattern must contain ?1 and ?2 placeholders
for the arguments.castPattern
in class Dialect
from
- a CastType
indicating the
type of the value argumentto
- a CastType
indicating the
type the value argument is cast topublic String translateExtractField(TemporalUnit unit)
Dialect
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
.
translateExtractField
in class Dialect
public String extractPattern(TemporalUnit unit)
Dialect
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
.
extractPattern
in class Dialect
unit
- the first argumentpublic boolean supportsFractionalTimestampArithmetic()
Dialect
supportsFractionalTimestampArithmetic
in class Dialect
public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType)
Dialect
timestampadd()
function call. The resulting
pattern must contain ?1, ?2, and ?3 placeholders
for the arguments.timestampaddPattern
in class Dialect
unit
- the first argumenttemporalType
- true if the third argument is apublic String timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType)
Dialect
timestampdiff()
function call. The resulting
pattern must contain ?1, ?2, and ?3 placeholders
for the arguments.timestampdiffPattern
in class Dialect
unit
- the first argumentfromTemporalType
- true if the first argument is
a timestamp, false if a datetoTemporalType
- true if the second argument ispublic String trimPattern(TrimSpec specification, char character)
Dialect
trim()
function call. The resulting
pattern must contain a ?1 placeholder for the
argument of type String
.trimPattern
in class AbstractTransactSQLDialect
specification
- leading
or trailing
character
- the character to trimpublic String translateDatetimeFormat(String format)
Dialect
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 all of
the pattern letter sequences understood by
DateTimeFormatter
, only the following
subset of pattern letters is accepted by
Hibernate:
translateDatetimeFormat
in class Dialect
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException
Dialect
null
is allowed and indicates that Hibernate should fallback 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 MIXEDIdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData)
IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData)
AnsiSqlKeywords.sql2003()
as reserved wordsbuildIdentifierHelper
in class Dialect
builder
- A semi-configured IdentifierHelper builder.dbMetaData
- Access to the metadata returned from the driver if needed and if available. WARNING: may be null
null
to indicate Hibernate should use its fallback pathSQLException
- Accessing the DatabaseMetaData can throw it. Just re-throw and Hibernate will handle.Dialect.getNameQualifierSupport()
Copyright © 2001-2021 Red Hat, Inc. All Rights Reserved.