Class OracleDialect
- All Implemented Interfaces:
FunctionContributor,TypeContributor,ConversionContext
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hibernate.dialect.Dialect
Dialect.SizeStrategy, Dialect.SizeStrategyImpl -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final booleanprotected final intprotected final intprotected final booleanstatic final StringFields 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
ConstructorsConstructorDescriptionOracleDialect(DatabaseVersion version) OracleDialect(DialectResolutionInfo info, OracleServerConfiguration serverConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendBinaryLiteral(SqlAppender appender, byte[] bytes) Append a binary literal to the givenSqlAppender.appendCheckConstraintOptions(CheckConstraint checkConstraint, String sqlCheckConstraint) Append theCheckConstraintoptions to SQL check sqlCheckConstraintvoidappendDatetimeFormat(SqlAppender appender, String format) Translate the given datetime format string from the pattern language defined by Java'sDateTimeFormatterto whatever pattern language is understood by the native datetime formatting function for this database (often theto_char()function).voidappendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal representing the givenjava.timevalue to the givenSqlAppender.buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) TheIdentifierHelperindicated by this dialect for handling identifier conversions.An instance ofSQLExceptionConversionDelegatefor interpreting dialect-specific error or SQLState codes.booleanDoes this dialect support creating and dropping schema?booleanIs there some way to disable foreign key constraint checking while truncating tables? (If there's no way to do it, and if we can't batch truncate, we must drop and recreate the constraints instead.)castPattern(CastType from, CastType to) type orTypes.TIMEtype, and its default behavior for casting dates and timestamps to and from strings is just awful.protected StringcolumnType(int sqlTypeCode) voidcontributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) A callback which allows theDialectto contribute types.createOptionalTableUpdateOperation(EntityMutationTarget mutationTarget, OptionalTableUpdate optionalTableUpdate, SessionFactoryImplementor factory) Create aMutationOperationfor a updating an optional tableTranslation of the HQLlocal_timefunction, which maps to the Java typeLocalTimewhich is a time with no time zone.Translation of the HQLlocal_datetimefunction, which maps to the Java typeLocalDateTimewhich is a datetime with no time zone.Translation of the HQL/JPQLcurrent_timefunction, which maps to the Java typeTimewhich is a time with no time zone.Translation of the HQL/JPQLcurrent_timestampfunction, which maps to the Java typeTimestampwhich is a datetime with no time zone.Translation of the HQLoffset_datetimefunction, which maps to the Java typeOffsetDateTimewhich is a datetime with a time zone.static ReplacerdatetimeFormat(String format, boolean useFm, boolean resetFm) booleanDo we need to drop constraints before dropping tables in this dialect?extractPattern(TemporalUnit unit) Oracle supports a limited list of temporal fields in the extract() function, but we can emulate some of them by using to_char() with a format string instead of extract().booleanMust LOB values occur last in inserts and updates?generatedAs(String generatedAs) Thegenerated asclause, or similar, for generated column declarations in DDL statements.The subcommand of thealter tablecommand used to add a column to a table, usuallyadd columnoradd.How does this dialect support aggregate types likeSqlTypes.STRUCT.getAlterColumnTypeString(String columnName, String columnType, String columnDefinition) The fragment of analter tablecommand which modifies a column type, or null if column types cannot be modified.getArrayTypeName(String javaElementTypeName, String elementTypeName, Integer maxLength) The SQL type name for the array type with elements of the given type name.TheCallableStatementSupportfor this database.The keyword that specifies that adrop tableoperation should be cascaded to its constraints, typically" cascade"where the leading space is required, or the empty string if there is no such keyword in this dialect.String[]getCreateEnumTypeCommand(String name, String[] values) The kind of user-defined type to create, or the empty string if this does not need to be specified.Get the SQL command used to retrieve the current schema name.The command used to retrieve the current timestamp from the database.intThe default value to use for the configuration property "hibernate.jdbc.batch_size".intThis is the default precision for a generated column of typeTIMESTAMPmapped to aTimestamporLocalDateTime.booleanThe default value to use for the configuration property "hibernate.jdbc.use_get_generated_keys".getDisableConstraintStatement(String tableName, String name) A SQL statement that temporarily disables checking of the given foreign key constraint.Get the minimumDmlTargetColumnQualifierSupportrequired by this dialect.intintString[]getDropEnumTypeCommand(String name) getEnableConstraintStatement(String tableName, String name) A SQL statement that re-enables checking of the given foreign key constraint.getEnumTypeDeclaration(String name, String[] values) If this database has a special MySQL-styleenumcolumn type, return the type declaration for the given enumeration of values.getFallbackSqmInsertStrategy(EntityMappingType rootEntityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext) TheSqmMultiTableInsertStrategyto use when not specified byQueryEngineOptions.getCustomSqmMultiTableInsertStrategy().getFallbackSqmMutationStrategy(EntityMappingType rootEntityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext) TheSqmMultiTableMutationStrategyto use when not specified byQueryEngineOptions.getCustomSqmMultiTableMutationStrategy().Retrieves theFOR UPDATE NOWAITsyntax specific to this dialect.getForUpdateNowaitString(String aliases) Get theFOR UPDATE OF column_list NOWAITfragment appropriate for this dialect, given the aliases of the columns to be write locked.Retrieves theFOR UPDATE SKIP LOCKEDsyntax specific to this dialect.getForUpdateSkipLockedString(String aliases) Get theFOR UPDATE OF column_list SKIP LOCKEDfragment appropriate for this dialect, given the aliases of the columns to be write locked.getForUpdateString(String aliases) Get theFOR UPDATE OF column_listfragment appropriate for this dialect, given the aliases of the columns to be write locked.longWe minimize multiplicative factors by using seconds (with fractional part) as the "native" precision for duration arithmetic.Determine how selected items are referenced in thegroup byclause.Get the appropriateIdentityColumnSupportfor this dialect.intReturn the limit that the underlying database places on the number of elements in anINpredicate.Obtain aLimitHandlerthat implements pagination support forQuery.setMaxResults(int)andQuery.setFirstResult(int).intWhat is the maximum length Hibernate can use for generated aliases?intWhat is the maximum identifier length supported by this dialect?intThe biggest size value that can be supplied as argument to aTypes.VARBINARY-like type.intThe biggest size value that can be supplied as argument to aTypes.VARCHAR-like type.protected DatabaseVersionGet the version of the SQL dialect that is the minimum supported by this implementation.The name identifying the "native" id generation strategy for this dialect.intThe JDBC type code to use for mapping properties of basic Java array orCollectiontypes.intThe JDBC type code to use for mapping properties of Java typeboolean.getQueryHintString(String sql, String hints) Apply a hint to the given SQL query.Get theselectcommand used retrieve the names of all sequences.getReadLockString(int timeout) Get the string to append toSELECTstatements to acquire READ locks for this dialect.getReadLockString(String aliases, int timeout) Get the string to append toSELECTstatements to acquire READ locks for this dialect, given the aliases of the columns to be read locked.Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom theOUTparameter.getResultSet(CallableStatement statement, int position) Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the positionalOUTparameter.getResultSet(CallableStatement statement, String name) Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the namedOUTparameter.Get the command used to select a GUID from the database.ASequenceInformationExtractorwhich is able to extractSequenceInformationfrom the JDBC result set returned whenDialect.getQuerySequencesString()is executed.Get the appropriateSequenceSupportfor this dialect.The kind of temporary tables that are supported on this database.An arbitrary SQL fragment appended to the end of the statement to create a temporary table, specifying dialect-specific options, ornullif there are no options to specify.How the dialect supports time zone types likeTypes.TIMESTAMP_WITH_TIMEZONE.Get theUniqueDelegatesupported by this dialectAViolatedConstraintNameExtractorfor extracting the name of a violated constraint from aSQLException.getWriteLockString(int timeout) Get the string to append toSELECTstatements to acquire pessimistic WRITE locks for this dialect.getWriteLockString(String aliases, int timeout) Get the string to append toSELECTstatements to acquire WRITE locks for this dialect, given the aliases of the columns to be write locked.The row lock strategy to use for write locks.protected voidSet appropriate default values for configuration properties.voidinitializeFunctionRegistry(FunctionContributions functionContributions) Initialize the given registry with any dialect-specific functions.booleanbooleanprotected static booleanDeprecated.booleanIs the command returned byDialect.getCurrentTimestampSelectString()treated as callable?booleanReturn whether the dialect considers an empty string value to be null.booleanprotected static booleanDeprecated.protected voidregisterColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Register ANSI-standard column types using the length limits defined byDialect.getMaxVarcharLength(),Dialect.getMaxNVarcharLength(), andDialect.getMaxVarbinaryLength().intregisterResultSetOutParameter(CallableStatement statement, int col) Registers a parameter capable of returning aResultSetby position, either anOUTparameter, or aREF_CURSORparameter as defined in Java 8.intregisterResultSetOutParameter(CallableStatement statement, String name) Registers a parameter capable of returning aResultSetby name, either anOUTparameter, or aREF_CURSORparameter as defined in Java 8.resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry) Assigns an appropriateJdbcTypeto a column of a JDBC result set based on the column type name, JDBC type code, precision, and scale.The name of arowid-like pseudo-column which acts as a high-performance row locator, or null if this dialect has no such pseudo-column.booleanDoes this dialect support modifying the type of an existing column?booleanOracle has neitherBITnorBOOLEAN.booleanDoes this dialect support commenting on tables and columns?booleanDoes this dialect support some way to retrieve the current timestamp value from the database?booleanDoes the dialect support an exists statement in the select clause?booleanDoes this dialect support the givenFETCHclause type.booleanDoes this dialect support thefromclause for update statements?booleanFor analter table, can the phraseif existsbe applied?booleanFor dropping a table, can the phraseif existsbe applied before the table name?booleanFor dropping a type, can the phraseif existsbe applied before the type name?booleanDoes this dialect fully support returning arbitrary generated column values after execution of aninsertstatement, using the JDBC methodConnection.prepareStatement(String, String[]).booleanDoes this dialect support the SQLlateralkeyword or a proprietary alternative?booleanDoes this dialect supportNO_WAITtimeout.booleanDoes this dialect supportoffsetin subqueries?booleanDoes is dialect supportpartition by?booleanDoes this dialect/database support recursive CTEs?booleanDoes this dialect supportSKIP_LOCKEDtimeout.booleanDoes this dialect supports timezone offsets in temporal literals.booleanDoes this dialect supportcount(distinct a,b)?booleanDoes this dialect supportvalueslists of formVALUES (1), (2), (3)?booleanDoes this dialect support window functions likerow_number() over (..)?timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType) Obtain a pattern for the SQL equivalent to atimestampadd()function call.timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType) Obtain a pattern for the SQL equivalent to atimestampdiff()function call.booleanuseFollowOnLocking(String sql, QueryOptions queryOptions) TheFOR UPDATEclause cannot be applied when usingORDER BY,DISTINCTor views.booleanShould LOBs (both BLOB and CLOB) be bound using stream operations, that is, usingPreparedStatement.setBinaryStream(int, java.io.InputStream, int)).Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendArrayLiteral, appendBooleanValueString, appendDateTimeLiteral, appendDateTimeLiteral, appendIntervalLiteral, appendLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, canBatchTruncate, canCreateCatalog, castType, checkVersion, closeQuote, contribute, contributeFunctions, defaultScrollMode, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, doesRoundTemporalOnOverflow, equivalentTypes, escapeComment, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getBeforeDropStatement, getCaseInsensitiveLike, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckConstraintString, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateEnumTypeCommand, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCrossReferenceParentTableFilter, getDefaultDecimalPrecision, getDefaultIntervalSecondScale, getDefaultLobLength, getDefaultNonContextualLobCreation, getDefaultProperties, getDisableConstraintsStatement, getDoublePrecision, getDropCatalogCommand, getDropEnumTypeCommand, getDropForeignKeyString, getDropSchemaCommand, getDropTableString, getDropUniqueKeyString, getEnableConstraintsStatement, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getFloatPrecision, getForeignKeyExporter, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctionalDependencyAnalysisSupport, getHqlTranslator, getIndexExporter, getKeywords, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarcharCapacity, getMultiKeyLoadSizingStrategy, getNameQualifierSupport, getNationalizationSupport, getNativeParameterMarkerStrategy, getNoColumnsInsertString, getNullColumnString, getNullColumnString, getNullOrdering, getParameterCountLimit, getQueryHintString, getReadRowLockStrategy, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSizeStrategy, getSqmTranslatorFactory, getTableCleaner, getTableComment, getTableExporter, getTableMigrator, getTableTypeString, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getTemporaryTableDdlTransactionHandling, getTemporaryTableDropCommand, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTruncateTableStatement, getTruncateTableStatements, getUniqueKeyExporter, getUserDefinedTypeComment, getVersion, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, isAnsiNullOn, isJdbcLogWarningsEnabledByDefault, isLob, openQuote, ordinal, prependComment, qualifyIndexName, quote, quoteCollation, registerDefaultKeywords, registerKeyword, registerKeywords, requiresCastForConcatenatingNonStrings, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeLength, rowIdSqlType, supportsBatchUpdates, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsConflictClauseForInsertCTE, supportsDistinctFromPredicate, supportsExpectedLobUsagePattern, supportsFractionalTimestampArithmetic, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsInsertReturning, supportsInsertReturningRowId, supportsIsTrue, supportsJdbcConnectionLobCreation, supportsLobValueChangePropagation, supportsLockTimeouts, supportsMaterializedLobAccess, supportsNamedParameters, supportsNationalizedMethods, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNullPrecedence, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsPredicateAsExpression, supportsRefCursors, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsStandardArrays, supportsStandardCurrentTimestampFunction, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTableOptions, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUpdateReturning, supportsValuesListForInsert, supportsWait, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, translateExtractField, trimPattern, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters, useConnectionToCreateLob, useCrossReferenceForeignKeys, useMaterializedLobWhenCapacityExceeded
-
Field Details
-
PREFER_LONG_RAW
- See Also:
-
autonomous
protected final boolean autonomous -
extended
protected final boolean extended -
applicationContinuity
protected final boolean applicationContinuity -
driverMajorVersion
protected final int driverMajorVersion -
driverMinorVersion
protected final int driverMinorVersion
-
-
Constructor Details
-
OracleDialect
public OracleDialect() -
OracleDialect
-
OracleDialect
-
OracleDialect
-
-
Method Details
-
isExtended
Deprecated. -
isAutonomous
Deprecated. -
isAutonomous
public boolean isAutonomous() -
isExtended
public boolean isExtended() -
isApplicationContinuity
public boolean isApplicationContinuity() -
getMinimumSupportedVersion
Description copied from class:DialectGet the version of the SQL dialect that is the minimum supported by this implementation.- Overrides:
getMinimumSupportedVersionin classDialect
-
getPreferredSqlTypeCodeForBoolean
public int getPreferredSqlTypeCodeForBoolean()Description copied from class:DialectThe JDBC type code to use for mapping properties of Java typeboolean.Usually
Types.BOOLEANorTypes.BIT.- Overrides:
getPreferredSqlTypeCodeForBooleanin classDialect- Returns:
- one of the type codes defined by
Types.
-
initializeFunctionRegistry
Description copied from class:DialectInitialize 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.timetypes:-
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:
initializeFunctionRegistryin classDialect
-
-
getMaxVarcharLength
public int getMaxVarcharLength()Description copied from class:DialectThe biggest size value that can be supplied as argument to aTypes.VARCHAR-like type.For longer column lengths, use some sort of
text-like type for the column.- Overrides:
getMaxVarcharLengthin classDialect
-
getMaxVarbinaryLength
public int getMaxVarbinaryLength()Description copied from class:DialectThe biggest size value that can be supplied as argument to aTypes.VARBINARY-like type.For longer column lengths, use some sort of
image-like type for the column.- Overrides:
getMaxVarbinaryLengthin classDialect
-
getSqlAstTranslatorFactory
Description copied from class:Dialect- Overrides:
getSqlAstTranslatorFactoryin classDialect- See Also:
-
currentDate
Description copied from class:DialectTranslation of the HQL/JPQLcurrent_datefunction, which maps to the Java typeDate, and of the HQLlocal_datefunction which maps to the Java typeLocalDate.- Overrides:
currentDatein classDialect
-
currentTime
Description copied from class:DialectTranslation of the HQL/JPQLcurrent_timefunction, which maps to the Java typeTimewhich is a time with no time zone. This contradicts ANSI SQL wherecurrent_timehas the typeTIME WITH TIME ZONE.It is recommended to override this in dialects for databases which support
localtimeortime at local.- Overrides:
currentTimein classDialect
-
currentTimestamp
Description copied from class:DialectTranslation of the HQL/JPQLcurrent_timestampfunction, which maps to the Java typeTimestampwhich is a datetime with no time zone. This contradicts ANSI SQL wherecurrent_timestamphas the typeTIMESTAMP WITH TIME ZONE.It is recommended to override this in dialects for databases which support
localtimestamportimestamp at local.- Overrides:
currentTimestampin classDialect
-
currentLocalTime
Description copied from class:DialectTranslation of the HQLlocal_timefunction, which maps to the Java typeLocalTimewhich is a time with no time zone. It should usually be the same SQL function as forDialect.currentTime().It is recommended to override this in dialects for databases which support
localtimeorcurrent_time at local.- Overrides:
currentLocalTimein classDialect
-
currentLocalTimestamp
Description copied from class:DialectTranslation of the HQLlocal_datetimefunction, which maps to the Java typeLocalDateTimewhich is a datetime with no time zone. It should usually be the same SQL function as forDialect.currentTimestamp().It is recommended to override this in dialects for databases which support
localtimestamporcurrent_timestamp at local.- Overrides:
currentLocalTimestampin classDialect
-
currentTimestampWithTimeZone
Description copied from class:DialectTranslation of the HQLoffset_datetimefunction, which maps to the Java typeOffsetDateTimewhich is a datetime with a time zone. This in principle correctly maps to the ANSI SQLcurrent_timestampwhich has the typeTIMESTAMP WITH TIME ZONE.- Overrides:
currentTimestampWithTimeZonein classDialect
-
supportsInsertReturningGeneratedKeys
public boolean supportsInsertReturningGeneratedKeys()Description copied from class:DialectDoes this dialect fully support returning arbitrary generated column values after execution of aninsertstatement, using the JDBC methodConnection.prepareStatement(String, String[]).Support for returning the generated value of an identity column via the JDBC method
Connection.prepareStatement(String, int)is insufficient here.- Overrides:
supportsInsertReturningGeneratedKeysin classDialect- Returns:
trueifGetGeneratedKeysDelegateworks for any sort of primary key column (not just identity columns), orfalseifGetGeneratedKeysDelegatedoes not work, or only works for specialized identity/"autoincrement" columns- See Also:
-
castPattern
type orTypes.TIMEtype, and its default behavior for casting dates and timestamps to and from strings is just awful.- Overrides:
castPatternin classDialect- Parameters:
from- aCastTypeindicating the type of the value argumentto- aCastTypeindicating the type the value argument is cast to
-
getFractionalSecondPrecisionInNanos
public long getFractionalSecondPrecisionInNanos()We minimize multiplicative factors by using seconds (with fractional part) as the "native" precision for duration arithmetic.- Overrides:
getFractionalSecondPrecisionInNanosin classDialect- Returns:
- the precision, specified as a quantity of nanoseconds
- See Also:
-
extractPattern
Oracle supports a limited list of temporal fields in the extract() function, but we can emulate some of them by using to_char() with a format string instead of extract().Thus, the additional supported fields are
TemporalUnit.DAY_OF_YEAR,TemporalUnit.DAY_OF_MONTH,TemporalUnit.DAY_OF_YEAR, andTemporalUnit.WEEK.- Overrides:
extractPatternin classDialect- Parameters:
unit- the first argument
-
timestampaddPattern
public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType) Description copied from class:DialectObtain a pattern for the SQL equivalent to atimestampadd()function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.- Overrides:
timestampaddPatternin 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:DialectObtain a pattern for the SQL equivalent to atimestampdiff()function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.- Overrides:
timestampdiffPatternin classDialect- Parameters:
unit- the first argumentfromTemporalType- true if the first argument is a timestamp, false if a datetoTemporalType- true if the second argument is
-
columnType
Description copied from class:DialectThe database column type name for a given JDBC type code defined inTypesorSqlTypes. This default implementation returns the ANSI-standard type name.This method may be overridden by concrete
Dialects as an alternative toDialect.registerColumnTypes(TypeContributions, ServiceRegistry)for simple registrations.Note that:
- Implementations of this method are expected to define a
sensible mapping for
Types.NCLOBTypes.NCHAR, andTypes.NVARCHAR. On some database, these types are simply remapped toCLOB,CHAR, andVARCHAR. - Mappings for
Types.TIMESTAMPandTypes.TIMESTAMP_WITH_TIMEZONEshould support explicit specification of precision if possible. - As specified by
DdlTypeRegistry.getDescriptor(int), this method never receivesTypes.LONGVARCHAR,Types.LONGNVARCHAR, norTypes.LONGVARBINARY, which are considered synonyms for their non-LONGcounterparts. - On the other hand, the types
SqlTypes.LONG32VARCHAR,SqlTypes.LONG32NVARCHAR, andSqlTypes.LONG32VARBINARYare not synonyms, and implementations of this method must define sensible mappings, for example to database-nativeTEXTorCLOBtypes.
- Overrides:
columnTypein classDialect- Parameters:
sqlTypeCode- a SQLtype code- Returns:
- a column type name, with
$l,$p,$splaceholders for length, precision, scale - See Also:
- Implementations of this method are expected to define a
sensible mapping for
-
registerColumnTypes
protected void registerColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Description copied from class:DialectRegister ANSI-standard column types using the length limits defined byDialect.getMaxVarcharLength(),Dialect.getMaxNVarcharLength(), andDialect.getMaxVarbinaryLength().This method is always called when a
Dialectis instantiated.- Overrides:
registerColumnTypesin classDialect
-
getTimeZoneSupport
Description copied from class:DialectHow the dialect supports time zone types likeTypes.TIMESTAMP_WITH_TIMEZONE.- Overrides:
getTimeZoneSupportin classDialect
-
initDefaultProperties
protected void initDefaultProperties()Description copied from class:DialectSet appropriate default values for configuration properties.This default implementation sets "hibernate.jdbc.batch_size", "hibernate.jdbc.lob.non_contextual_creation", and "hibernate.jdbc.use_get_generated_keys" to defaults determined by calling
Dialect.getDefaultStatementBatchSize(),Dialect.getDefaultNonContextualLobCreation(), andDialect.getDefaultUseGetGeneratedKeys().An implementation may set additional configuration properties, but this is discouraged.
- Overrides:
initDefaultPropertiesin classDialect
-
getDefaultStatementBatchSize
public int getDefaultStatementBatchSize()Description copied from class:DialectThe default value to use for the configuration property "hibernate.jdbc.batch_size".- Overrides:
getDefaultStatementBatchSizein classDialect
-
getDefaultUseGetGeneratedKeys
public boolean getDefaultUseGetGeneratedKeys()Description copied from class:DialectThe default value to use for the configuration property "hibernate.jdbc.use_get_generated_keys".- Overrides:
getDefaultUseGetGeneratedKeysin classDialect
-
resolveSqlTypeDescriptor
public JdbcType resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry) Description copied from class:DialectAssigns an appropriateJdbcTypeto a column of a JDBC result set based on the column type name, JDBC type code, precision, and scale.- Overrides:
resolveSqlTypeDescriptorin classDialect- Parameters:
columnTypeName- the column type namejdbcTypeCode- thetype codeprecision- the precision or 0scale- the scale or 0- Returns:
- an appropriate instance of
JdbcType
-
supportsBitType
public boolean supportsBitType()Oracle has neitherBITnorBOOLEAN.- Overrides:
supportsBitTypein classDialect- Returns:
- false
-
getArrayTypeName
public String getArrayTypeName(String javaElementTypeName, String elementTypeName, Integer maxLength) Description copied from class:DialectThe SQL type name for the array type with elements of the given type name.The ANSI-standard syntax is
integer array.- Overrides:
getArrayTypeNamein classDialect
-
getPreferredSqlTypeCodeForArray
public int getPreferredSqlTypeCodeForArray()Description copied from class:DialectThe JDBC type code to use for mapping properties of basic Java array orCollectiontypes.Usually
SqlTypes.ARRAYorSqlTypes.VARBINARY.- Overrides:
getPreferredSqlTypeCodeForArrayin classDialect- Returns:
- one of the type codes defined by
SqlTypes.
-
getUserDefinedTypeExporter
Description copied from class:Dialect- Overrides:
getUserDefinedTypeExporterin classDialect
-
contributeTypes
Description copied from class:DialectA callback which allows theDialectto contribute types.- Overrides:
contributeTypesin classDialect- Parameters:
typeContributions- Callback to contribute the typesserviceRegistry- The service registry
-
getAggregateSupport
Description copied from class:DialectHow does this dialect support aggregate types likeSqlTypes.STRUCT.- Overrides:
getAggregateSupportin classDialect
-
getNativeIdentifierGeneratorStrategy
Description copied from class:DialectThe name identifying the "native" id generation strategy for this dialect.This is the name of the id generation strategy which should be used when
"native"is specified inhbm.xml.- Overrides:
getNativeIdentifierGeneratorStrategyin classDialect- Returns:
- The name identifying the native generator strategy.
-
getIdentityColumnSupport
Description copied from class:DialectGet the appropriateIdentityColumnSupportfor this dialect.- Overrides:
getIdentityColumnSupportin classDialect- Returns:
- the IdentityColumnSupport
-
getLimitHandler
Description copied from class:DialectObtain aLimitHandlerthat implements pagination support forQuery.setMaxResults(int)andQuery.setFirstResult(int).- Overrides:
getLimitHandlerin classDialect
-
getCurrentTimestampSelectString
Description copied from class:DialectThe command used to retrieve the current timestamp from the database.- Overrides:
getCurrentTimestampSelectStringin classDialect
-
getGroupBySelectItemReferenceStrategy
Description copied from class:DialectDetermine how selected items are referenced in thegroup byclause.- Overrides:
getGroupBySelectItemReferenceStrategyin classDialect
-
supportsValuesList
public boolean supportsValuesList()Description copied from class:DialectDoes this dialect supportvalueslists of formVALUES (1), (2), (3)?- Overrides:
supportsValuesListin classDialect- Returns:
trueifvalueslist are supported
-
getAddColumnString
Description copied from class:DialectThe subcommand of thealter tablecommand used to add a column to a table, usuallyadd columnoradd.- Overrides:
getAddColumnStringin classDialect- Returns:
- The
add columnfragment.
-
supportsIfExistsBeforeTableName
public boolean supportsIfExistsBeforeTableName()Description copied from class:DialectFor dropping a table, can the phraseif existsbe applied before the table name?- Overrides:
supportsIfExistsBeforeTableNamein classDialect- Returns:
trueifif existscan be applied before the table name
-
supportsIfExistsAfterAlterTable
public boolean supportsIfExistsAfterAlterTable()Description copied from class:DialectFor analter table, can the phraseif existsbe applied?- Overrides:
supportsIfExistsAfterAlterTablein classDialect- Returns:
trueifif existscan be applied afteralter table
-
supportsIfExistsBeforeTypeName
public boolean supportsIfExistsBeforeTypeName()Description copied from class:DialectFor dropping a type, can the phraseif existsbe applied before the type name?- Overrides:
supportsIfExistsBeforeTypeNamein classDialect- Returns:
trueifif existscan be applied before the type name
-
getCascadeConstraintsString
Description copied from class:DialectThe keyword that specifies that adrop tableoperation should be cascaded to its constraints, typically" cascade"where the leading space is required, or the empty string if there is no such keyword in this dialect.- Overrides:
getCascadeConstraintsStringin classDialect- Returns:
- The cascade drop keyword, if any, with a leading space
-
dropConstraints
public boolean dropConstraints()Description copied from class:DialectDo we need to drop constraints before dropping tables in this dialect?- Overrides:
dropConstraintsin classDialect- Returns:
- True if constraints must be dropped prior to dropping the table; false otherwise.
-
getAlterColumnTypeString
public String getAlterColumnTypeString(String columnName, String columnType, String columnDefinition) Description copied from class:DialectThe fragment of analter tablecommand which modifies a column type, or null if column types cannot be modified. Oftenalter column col_name set data type col_type.- Overrides:
getAlterColumnTypeStringin 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:DialectDoes this dialect support modifying the type of an existing column?- Overrides:
supportsAlterColumnTypein classDialect
-
getSequenceSupport
Description copied from class:DialectGet the appropriateSequenceSupportfor this dialect.- Overrides:
getSequenceSupportin classDialect
-
getQuerySequencesString
Description copied from class:DialectGet theselectcommand used retrieve the names of all sequences.- Overrides:
getQuerySequencesStringin classDialect- Returns:
- The select command; or null if sequences are not supported.
-
getSequenceInformationExtractor
Description copied from class:DialectASequenceInformationExtractorwhich is able to extractSequenceInformationfrom the JDBC result set returned whenDialect.getQuerySequencesString()is executed.- Overrides:
getSequenceInformationExtractorin classDialect
-
getSelectGUIDString
Description copied from class:DialectGet the command used to select a GUID from the database.Optional operation.
- Overrides:
getSelectGUIDStringin classDialect- Returns:
- The appropriate command.
-
getViolatedConstraintNameExtractor
Description copied from class:DialectAViolatedConstraintNameExtractorfor extracting the name of a violated constraint from aSQLException.- Specified by:
getViolatedConstraintNameExtractorin interfaceConversionContext- Overrides:
getViolatedConstraintNameExtractorin classDialect
-
buildSQLExceptionConversionDelegate
Description copied from class:DialectAn instance ofSQLExceptionConversionDelegatefor interpreting dialect-specific error or SQLState codes.If this method is overridden to return a non-null value, the default
SQLExceptionConverterwill use the returnedSQLExceptionConversionDelegatein addition to the following standard delegates:- a "static" delegate based on the JDBC4-defined
SQLExceptionhierarchy, and - a delegate that interprets SQLState codes as either X/Open or SQL-2003 codes, depending on what is reported by the JDBC driver.
It is strongly recommended that every
Dialectimplementation override this method, since interpretation of a SQL error is much more accurate when based on the vendor-specific error code, rather than on the SQLState.- Overrides:
buildSQLExceptionConversionDelegatein classDialect- Returns:
- The
SQLExceptionConversionDelegatefor this dialect
- a "static" delegate based on the JDBC4-defined
-
registerResultSetOutParameter
Description copied from class:DialectRegisters a parameter capable of returning aResultSetby position, either anOUTparameter, or aREF_CURSORparameter as defined in Java 8.- Overrides:
registerResultSetOutParameterin classDialect- Parameters:
statement- The callable statement.col- The bind position at which to register the output param.- Returns:
- The number of (contiguous) bind positions used.
- Throws:
SQLException- Indicates problems registering the param.
-
getResultSet
Description copied from class:DialectGiven a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom theOUTparameter.- Overrides:
getResultSetin classDialect- Parameters:
ps- The callable statement.- Returns:
- The extracted result set.
- Throws:
SQLException- Indicates problems extracting the result set.
-
supportsCommentOn
public boolean supportsCommentOn()Description copied from class:DialectDoes this dialect support commenting on tables and columns?- Overrides:
supportsCommentOnin classDialect- Returns:
trueif commenting is supported
-
supportsCurrentTimestampSelection
public boolean supportsCurrentTimestampSelection()Description copied from class:DialectDoes this dialect support some way to retrieve the current timestamp value from the database?- Overrides:
supportsCurrentTimestampSelectionin classDialect- Returns:
- True if the current timestamp can be retrieved; false otherwise.
-
isCurrentTimestampSelectStringCallable
public boolean isCurrentTimestampSelectStringCallable()Description copied from class:DialectIs the command returned byDialect.getCurrentTimestampSelectString()treated as callable?Typically, this indicates the use of the JDBC escape syntax.
- Overrides:
isCurrentTimestampSelectStringCallablein classDialect- Returns:
- if the
Dialect.getCurrentTimestampSelectString()is treated as callable; false otherwise.
-
supportsExistsInSelect
public boolean supportsExistsInSelect()Description copied from class:DialectDoes the dialect support an exists statement in the select clause?- Overrides:
supportsExistsInSelectin classDialect- Returns:
- True if exists checks are allowed in the select clause; false otherwise.
-
getInExpressionCountLimit
public int getInExpressionCountLimit()Description copied from class:DialectReturn the limit that the underlying database places on the number of elements in anINpredicate. If the database defines no such limits, simply return zero or a number smaller than zero.- Overrides:
getInExpressionCountLimitin classDialect- Returns:
- The limit, or a non-positive integer to indicate no limit.
-
forceLobAsLastValue
public boolean forceLobAsLastValue()Description copied from class:DialectMust LOB values occur last in inserts and updates?- Overrides:
forceLobAsLastValuein classDialect- Returns:
- boolean True if Lob values should be last, false if it does not matter.
-
isEmptyStringTreatedAsNull
public boolean isEmptyStringTreatedAsNull()Description copied from class:DialectReturn whether the dialect considers an empty string value to be null.- Overrides:
isEmptyStringTreatedAsNullin classDialect- Returns:
- boolean True if an empty string is treated as null, false otherwise.
-
getFallbackSqmMutationStrategy
public SqmMultiTableMutationStrategy getFallbackSqmMutationStrategy(EntityMappingType rootEntityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext) Description copied from class:DialectTheSqmMultiTableMutationStrategyto use when not specified byQueryEngineOptions.getCustomSqmMultiTableMutationStrategy(). -
getFallbackSqmInsertStrategy
public SqmMultiTableInsertStrategy getFallbackSqmInsertStrategy(EntityMappingType rootEntityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext) Description copied from class:DialectTheSqmMultiTableInsertStrategyto use when not specified byQueryEngineOptions.getCustomSqmMultiTableInsertStrategy(). -
getSupportedTemporaryTableKind
Description copied from class:DialectThe kind of temporary tables that are supported on this database.- Overrides:
getSupportedTemporaryTableKindin classDialect
-
getTemporaryTableCreateOptions
Description copied from class:DialectAn arbitrary SQL fragment appended to the end of the statement to create a temporary table, specifying dialect-specific options, ornullif there are no options to specify.- Overrides:
getTemporaryTableCreateOptionsin classDialect
-
useFollowOnLocking
TheFOR UPDATEclause cannot be applied when usingORDER BY,DISTINCTor views.- Overrides:
useFollowOnLockingin classDialect- Returns:
trueindicates that the dialect requests that locking be applied by subsequent select;false(the default) indicates that locking should be applied to the main SQL statement.- See Also:
-
getQueryHintString
Description copied from class:DialectApply a hint to the given SQL query.The entire query is provided, allowing full control over the placement and syntax of the hint.
By default, ignore the hint and simply return the query.
- Overrides:
getQueryHintStringin classDialect- Parameters:
sql- The query to which to apply the hint.hints- The hints to apply- Returns:
- The modified SQL
-
getMaxAliasLength
public int getMaxAliasLength()Description copied from class:DialectWhat is the maximum length Hibernate can use for generated aliases?- Overrides:
getMaxAliasLengthin classDialect- Returns:
- The maximum length.
-
getMaxIdentifierLength
public int getMaxIdentifierLength()Description copied from class:DialectWhat is the maximum identifier length supported by this dialect?- Overrides:
getMaxIdentifierLengthin classDialect- Returns:
- The maximum length.
-
getDefaultTimestampPrecision
public int getDefaultTimestampPrecision()Description copied from class:DialectThis is the default precision for a generated column of typeTIMESTAMPmapped to aTimestamporLocalDateTime.Usually 6 (microseconds) or 3 (milliseconds).
- Overrides:
getDefaultTimestampPrecisionin classDialect- Returns:
- the default precision, in decimal digits, of the fractional seconds field
- See Also:
-
getCallableStatementSupport
Description copied from class:DialectTheCallableStatementSupportfor this database. Does this database support returning cursors?- Overrides:
getCallableStatementSupportin classDialect
-
canCreateSchema
public boolean canCreateSchema()Description copied from class:DialectDoes this dialect support creating and dropping schema?- Overrides:
canCreateSchemain classDialect- Returns:
- True if the dialect supports schema creation; false otherwise.
-
getCurrentSchemaCommand
Description copied from class:DialectGet the SQL command used to retrieve the current schema name.Works in conjunction with
Dialect.getSchemaNameResolver(), unless the resultingSchemaNameResolverdoes not need this information. For example, a custom implementation might make use of the Java 1.7Connection.getSchema()method.- Overrides:
getCurrentSchemaCommandin classDialect- Returns:
- The current schema retrieval SQL
-
supportsPartitionBy
public boolean supportsPartitionBy()Description copied from class:DialectDoes is dialect supportpartition by?- Overrides:
supportsPartitionByin classDialect
-
supportsTupleDistinctCounts
public boolean supportsTupleDistinctCounts()Description copied from class:DialectDoes this dialect supportcount(distinct a,b)?- Overrides:
supportsTupleDistinctCountsin classDialect- Returns:
- True if the database supports counting distinct tuples; false otherwise.
-
supportsOffsetInSubquery
public boolean supportsOffsetInSubquery()Description copied from class:DialectDoes this dialect supportoffsetin subqueries?For example:
select * from Table1 where col1 in (select col1 from Table2 order by col2 limit 1 offset 1)
- Overrides:
supportsOffsetInSubqueryin classDialect- Returns:
trueif it does
-
supportsFetchClause
Description copied from class:DialectDoes this dialect support the givenFETCHclause type.- Overrides:
supportsFetchClausein classDialect- Parameters:
type- The fetch clause type- Returns:
trueif the underlying database supports the given fetch clause type,falseotherwise. The default isfalse.
-
supportsWindowFunctions
public boolean supportsWindowFunctions()Description copied from class:DialectDoes this dialect support window functions likerow_number() over (..)?- Overrides:
supportsWindowFunctionsin classDialect- Returns:
trueif the underlying database supports window functions,falseotherwise. The default isfalse.
-
supportsRecursiveCTE
public boolean supportsRecursiveCTE()Description copied from class:DialectDoes this dialect/database support recursive CTEs?- Overrides:
supportsRecursiveCTEin classDialect- Returns:
trueif recursive CTEs are supported
-
supportsLateral
public boolean supportsLateral()Description copied from class:DialectDoes this dialect support the SQLlateralkeyword or a proprietary alternative?- Overrides:
supportsLateralin classDialect- Returns:
trueif the underlying database supports lateral,falseotherwise. The default isfalse.
-
supportsNoWait
public boolean supportsNoWait()Description copied from class:DialectDoes this dialect supportNO_WAITtimeout.- Overrides:
supportsNoWaitin classDialect- Returns:
trueifNO_WAITis supported
-
supportsSkipLocked
public boolean supportsSkipLocked()Description copied from class:DialectDoes this dialect supportSKIP_LOCKEDtimeout.- Overrides:
supportsSkipLockedin classDialect- Returns:
trueif SKIP_LOCKED is supported
-
getWriteRowLockStrategy
Description copied from class:DialectThe row lock strategy to use for write locks.- Overrides:
getWriteRowLockStrategyin classDialect
-
getForUpdateNowaitString
Description copied from class:DialectRetrieves theFOR UPDATE NOWAITsyntax specific to this dialect.- Overrides:
getForUpdateNowaitStringin classDialect- Returns:
- The appropriate
FOR UPDATE NOWAITclause string.
-
getForUpdateString
Description copied from class:DialectGet theFOR UPDATE OF column_listfragment appropriate for this dialect, given the aliases of the columns to be write locked.- Overrides:
getForUpdateStringin classDialect- Parameters:
aliases- The columns to be write locked.- Returns:
- The appropriate
FOR UPDATE OF column_listclause string.
-
getForUpdateNowaitString
Description copied from class:DialectGet theFOR UPDATE OF column_list NOWAITfragment appropriate for this dialect, given the aliases of the columns to be write locked.- Overrides:
getForUpdateNowaitStringin classDialect- Parameters:
aliases- The columns to be write locked.- Returns:
- The appropriate
FOR UPDATE OF colunm_list NOWAITclause string.
-
getForUpdateSkipLockedString
Description copied from class:DialectRetrieves theFOR UPDATE SKIP LOCKEDsyntax specific to this dialect.- Overrides:
getForUpdateSkipLockedStringin classDialect- Returns:
- The appropriate
FOR UPDATE SKIP LOCKEDclause string.
-
getForUpdateSkipLockedString
Description copied from class:DialectGet theFOR UPDATE OF column_list SKIP LOCKEDfragment appropriate for this dialect, given the aliases of the columns to be write locked.- Overrides:
getForUpdateSkipLockedStringin classDialect- Parameters:
aliases- The columns to be write locked.- Returns:
- The appropriate
FOR UPDATE colunm_list SKIP LOCKEDclause string.
-
getWriteLockString
Description copied from class:DialectGet the string to append toSELECTstatements to acquire pessimistic WRITE locks for this dialect.Location of the returned string is treated the same as
Dialect.getForUpdateString().- Overrides:
getWriteLockStringin classDialect- Parameters:
timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCKclause string.
-
getWriteLockString
Description copied from class:DialectGet the string to append toSELECTstatements to acquire WRITE locks for this dialect, given the aliases of the columns to be write locked.Location of the returned string is treated the same as
Dialect.getForUpdateString().- Overrides:
getWriteLockStringin classDialect- Parameters:
aliases- The columns to be read locked.timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCKclause string.
-
getReadLockString
Description copied from class:DialectGet the string to append toSELECTstatements to acquire READ locks for this dialect.Location of the returned string is treated the same as
Dialect.getForUpdateString().- Overrides:
getReadLockStringin classDialect- Parameters:
timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCKclause string.
-
getReadLockString
Description copied from class:DialectGet the string to append toSELECTstatements to acquire READ locks for this dialect, given the aliases of the columns to be read locked.Location of the returned string is treated the same as
Dialect.getForUpdateString().- Overrides:
getReadLockStringin classDialect- Parameters:
aliases- The columns to be read locked.timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCKclause string.
-
supportsTemporalLiteralOffset
public boolean supportsTemporalLiteralOffset()Description copied from class:DialectDoes this dialect supports timezone offsets in temporal literals.- Overrides:
supportsTemporalLiteralOffsetin classDialect
-
appendDateTimeLiteral
public void appendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone) Description copied from class:DialectAppend a datetime literal representing the givenjava.timevalue to the givenSqlAppender.- Overrides:
appendDateTimeLiteralin classDialect
-
appendDatetimeFormat
Description copied from class:DialectTranslate the given datetime format string from the pattern language defined by Java'sDateTimeFormatterto 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:
appendDatetimeFormatin classDialect
-
datetimeFormat
-
appendBinaryLiteral
Description copied from class:DialectAppend a binary literal to the givenSqlAppender.- Overrides:
appendBinaryLiteralin classDialect
-
getResultSet
Description copied from class:DialectGiven a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the positionalOUTparameter.- Overrides:
getResultSetin classDialect- Parameters:
statement- The callable statement.position- The bind position at which to register the output param.- Returns:
- The extracted result set.
- Throws:
SQLException- Indicates problems extracting the result set.
-
registerResultSetOutParameter
public int registerResultSetOutParameter(CallableStatement statement, String name) throws SQLException Description copied from class:DialectRegisters a parameter capable of returning aResultSetby name, either anOUTparameter, or aREF_CURSORparameter as defined in Java 8.- Overrides:
registerResultSetOutParameterin classDialect- Parameters:
statement- The callable statement.name- The parameter name (for drivers which support named parameters).- Returns:
- The number of (contiguous) bind positions used.
- Throws:
SQLException- Indicates problems registering the param.
-
getResultSet
Description copied from class:DialectGiven a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the namedOUTparameter.- Overrides:
getResultSetin classDialect- Parameters:
statement- The callable statement.name- The parameter name (for drivers which support named parameters).- Returns:
- The extracted result set.
- Throws:
SQLException- Indicates problems extracting the result set.
-
generatedAs
Description copied from class:DialectThegenerated asclause, or similar, for generated column declarations in DDL statements.- Overrides:
generatedAsin classDialect- Parameters:
generatedAs- a SQL expression used to generate the column value- Returns:
- The
generated asclause containing the given expression
-
buildIdentifierHelper
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException Description copied from class:DialectTheIdentifierHelperindicated by this dialect for handling identifier conversions. Returningnullis 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:
buildIdentifierHelperin 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
IdentifierHelperinstance to use, ornullto indicate Hibernate should use its fallback path - Throws:
SQLException- Accessing theDatabaseMetaDatacan throw it. Just rethrow and Hibernate will handle it.- See Also:
-
canDisableConstraints
public boolean canDisableConstraints()Description copied from class:DialectIs there some way to disable foreign key constraint checking while truncating tables? (If there's no way to do it, and if we can't batch truncate, we must drop and recreate the constraints instead.)- Overrides:
canDisableConstraintsin classDialect- Returns:
trueif there is some way to do it- See Also:
-
getDisableConstraintStatement
Description copied from class:DialectA SQL statement that temporarily disables checking of the given foreign key constraint.- Overrides:
getDisableConstraintStatementin classDialect- Parameters:
tableName- the name of the tablename- the name of the constraint
-
getEnableConstraintStatement
Description copied from class:DialectA SQL statement that re-enables checking of the given foreign key constraint.- Overrides:
getEnableConstraintStatementin classDialect- Parameters:
tableName- the name of the tablename- the name of the constraint
-
getUniqueDelegate
Description copied from class:DialectGet theUniqueDelegatesupported by this dialect- Overrides:
getUniqueDelegatein classDialect- Returns:
- The UniqueDelegate
-
getCreateUserDefinedTypeKindString
Description copied from class:DialectThe kind of user-defined type to create, or the empty string if this does not need to be specified. Included aftercreate type type_name as, but before the list of members.- Overrides:
getCreateUserDefinedTypeKindStringin classDialect
-
rowId
Description copied from class:DialectThe name of arowid-like pseudo-column which acts as a high-performance row locator, or null if this dialect has no such pseudo-column.If the
rowid-like value is an explicitly-declared named column instead of an implicit pseudo-column, and if the given name is nonempty, return the given name.- Overrides:
rowIdin classDialect- Parameters:
rowId- the name specified byRowId.value(), which is ignored ifDialect.getRowIdColumnString(java.lang.String)is not overridden
-
createOptionalTableUpdateOperation
public MutationOperation createOptionalTableUpdateOperation(EntityMutationTarget mutationTarget, OptionalTableUpdate optionalTableUpdate, SessionFactoryImplementor factory) Description copied from class:DialectCreate aMutationOperationfor a updating an optional table- Overrides:
createOptionalTableUpdateOperationin classDialect
-
getDmlTargetColumnQualifierSupport
Description copied from class:DialectGet the minimumDmlTargetColumnQualifierSupportrequired by this dialect.- Overrides:
getDmlTargetColumnQualifierSupportin classDialect- Returns:
- the column qualifier support required by this dialect
-
supportsFromClauseInUpdate
public boolean supportsFromClauseInUpdate()Description copied from class:DialectDoes this dialect support thefromclause for update statements?- Overrides:
supportsFromClauseInUpdatein classDialect- Returns:
trueiffromclause is supported
-
getDriverMajorVersion
public int getDriverMajorVersion() -
getDriverMinorVersion
public int getDriverMinorVersion() -
getEnumTypeDeclaration
Description copied from class:DialectIf this database has a special MySQL-styleenumcolumn type, return the type declaration for the given enumeration of values.If the database has no such type, return
null.- Overrides:
getEnumTypeDeclarationin classDialectvalues- the enumerated values of the type- Returns:
- the DDL column type declaration
-
getCreateEnumTypeCommand
- Overrides:
getCreateEnumTypeCommandin classDialect
-
getDropEnumTypeCommand
- Overrides:
getDropEnumTypeCommandin classDialect
-
useInputStreamToInsertBlob
public boolean useInputStreamToInsertBlob()Description copied from class:DialectShould LOBs (both BLOB and CLOB) be bound using stream operations, that is, usingPreparedStatement.setBinaryStream(int, java.io.InputStream, int)).- Overrides:
useInputStreamToInsertBlobin classDialect- Returns:
- True if BLOBs and CLOBs should be bound using stream operations.
-
appendCheckConstraintOptions
public String appendCheckConstraintOptions(CheckConstraint checkConstraint, String sqlCheckConstraint) Description copied from class:DialectAppend theCheckConstraintoptions to SQL check sqlCheckConstraint- Overrides:
appendCheckConstraintOptionsin classDialect- Parameters:
checkConstraint- an instance ofCheckConstraintsqlCheckConstraint- the SQL to append theCheckConstraintoptions- Returns:
- a SQL expression
-