Package org.hibernate.dialect
Class HANAColumnStoreDialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.AbstractHANADialect
-
- org.hibernate.dialect.HANAColumnStoreDialect
-
- All Implemented Interfaces:
FunctionContributor
,TypeContributor
,ConversionContext
- Direct Known Subclasses:
HANACloudColumnStoreDialect
,HANASpatialDialect
public class HANAColumnStoreDialect extends AbstractHANADialect
An SQL dialect for the SAP HANA column store.For more information on interacting with the SAP HANA database, refer to the SAP HANA SQL and System Views Reference and the SAP HANA Client Interface Programming Reference.
Column tables are created by this dialect when using the auto-ddl feature.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.dialect.AbstractHANADialect
AbstractHANADialect.HANABlobType
-
Nested classes/interfaces inherited from class org.hibernate.dialect.Dialect
Dialect.SizeStrategy, Dialect.SizeStrategyImpl
-
-
Field Summary
-
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 HANAColumnStoreDialect()
HANAColumnStoreDialect(DatabaseVersion version)
HANAColumnStoreDialect(DialectResolutionInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCreateTableString()
The command used to create a table, usuallycreate table
.SqmMultiTableInsertStrategy
getFallbackSqmInsertStrategy(EntityMappingType entityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext)
TheSqmMultiTableInsertStrategy
to use when not specified byQueryEngineOptions.getCustomSqmMultiTableInsertStrategy()
.SqmMultiTableMutationStrategy
getFallbackSqmMutationStrategy(EntityMappingType entityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext)
TheSqmMultiTableMutationStrategy
to use when not specified byQueryEngineOptions.getCustomSqmMultiTableMutationStrategy()
.int
getMaxVarcharLength()
The biggest size value that can be supplied as argument to aTypes.VARCHAR
-like type.TemporaryTableKind
getSupportedTemporaryTableKind()
The kind of temporary tables that are supported on this database.String
getTemporaryTableCreateCommand()
The command to create a temporary table.String
getTemporaryTableCreateOptions()
An arbitrary SQL fragment appended to the end of the statement to create a temporary table, specifying dialect-specific options, ornull
if there are no options to specify.String
getTemporaryTableTruncateCommand()
The command to truncate a temporary table.void
initializeFunctionRegistry(FunctionContributions functionContributions)
Initialize the given registry with any dialect-specific functions.boolean
isUseUnicodeStringTypes()
protected void
registerDefaultKeywords()
Register the reserved words of ANSI-standard SQL as keywords.protected boolean
supportsAsciiStringTypes()
protected Boolean
useUnicodeStringTypesDefault()
-
Methods inherited from class org.hibernate.dialect.AbstractHANADialect
appendBooleanValueString, appendDatetimeFormat, appendDateTimeLiteral, appendDateTimeLiteral, buildIdentifierHelper, buildSQLExceptionConversionDelegate, castPattern, columnType, contributeTypes, createVersion, defaultScrollMode, dropConstraints, extractPattern, generatedAs, getAddColumnString, getAddColumnSuffixString, getBlobTypeDescriptor, getCallableStatementSupport, getCascadeConstraintsString, getColumnComment, getCurrentSchemaCommand, getCurrentTimestampSelectString, getDefaultDecimalPrecision, getDefaultNonContextualLobCreation, getDefaultUseGetGeneratedKeys, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getFractionalSecondPrecisionInNanos, getIdentityColumnSupport, getLimitHandler, getMaxAliasLength, getMaxIdentifierLength, getMaxNVarcharLength, getMaxVarbinaryLength, getNameQualifierSupport, getNullOrdering, getQueryHintString, getQuerySequencesString, getReadLockString, getReadLockString, getSelectGUIDString, getSequenceInformationExtractor, getSequenceSupport, getSqlAstTranslatorFactory, getTableComment, getTableExporter, getWriteLockString, getWriteLockString, getWriteRowLockStrategy, isCurrentTimestampSelectStringCallable, registerColumnTypes, registerResultSetOutParameter, registerResultSetOutParameter, supportsColumnCheck, supportsCommentOn, supportsCurrentTimestampSelection, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsFractionalTimestampArithmetic, supportsJdbcConnectionLobCreation, supportsLateral, supportsNoColumnsInsert, supportsNoWait, supportsOffsetInSubquery, supportsOrderByInSubquery, supportsPartitionBy, supportsTableCheck, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsValuesListForInsert, supportsWindowFunctions, timestampaddPattern, timestampdiffPattern
-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendArrayLiteral, appendBinaryLiteral, appendDateTimeLiteral, appendIntervalLiteral, appendLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, canBatchTruncate, canCreateCatalog, canCreateSchema, canDisableConstraints, castType, checkVersion, closeQuote, contribute, contributeFunctions, createOptionalTableUpdateOperation, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestamp, currentTimestampWithTimeZone, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, equivalentTypes, escapeComment, forceLobAsLastValue, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAggregateSupport, getAlterColumnTypeString, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getCaseInsensitiveLike, getCheckCondition, getCheckCondition, getColumnAliasExtractor, getCreateCatalogCommand, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCreateUserDefinedTypeKindString, getDefaultLobLength, getDefaultProperties, getDefaultStatementBatchSize, getDefaultTimestampPrecision, getDisableConstraintsStatement, getDisableConstraintStatement, getDmlTargetColumnQualifierSupport, getDoublePrecision, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropTableString, getDropUniqueKeyString, getEnableConstraintsStatement, getEnableConstraintStatement, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getFloatPrecision, getForeignKeyExporter, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getGroupBySelectItemReferenceStrategy, getHqlTranslator, getIndexExporter, getInExpressionCountLimit, getKeywords, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxNVarcharCapacity, getMaxVarbinaryCapacity, getMaxVarcharCapacity, getMinimumSupportedVersion, getMultiKeyLoadSizingStrategy, getNationalizationSupport, getNativeIdentifierGenerationType, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNoColumnsInsertString, getNullColumnString, getNullColumnString, getParameterCountLimit, getPreferredSqlTypeCodeForArray, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getReadRowLockStrategy, getResultSet, getResultSet, getResultSet, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSizeStrategy, getSqmTranslatorFactory, getTableCleaner, getTableMigrator, getTableTypeString, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableDdlTransactionHandling, getTemporaryTableDropCommand, getTemporaryTableExporter, getTimeoutInSeconds, getTimeZoneSupport, getTruncateTableStatement, getTruncateTableStatements, getUniqueDelegate, getUniqueKeyExporter, getUserDefinedTypeComment, getUserDefinedTypeExporter, getVersion, getViolatedConstraintNameExtractor, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, initDefaultProperties, inlineLiteral, isAnsiNullOn, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLob, isLockTimeoutParameterized, openQuote, ordinal, prependComment, qualifyIndexName, quote, registerKeyword, registerKeywords, requiresCastForConcatenatingNonStrings, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeDescriptor, resolveSqlTypeLength, rowId, rowIdSqlType, supportsAlterColumnType, supportsBindAsCallableArgument, supportsBitType, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsDistinctFromPredicate, supportsFetchClause, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsIfExistsBeforeTypeName, supportsInsertReturning, supportsInsertReturningGeneratedKeys, supportsLobValueChangePropagation, supportsLockTimeouts, supportsMaterializedLobAccess, supportsNamedParameters, supportsNonQueryWithCTE, supportsNullPrecedence, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPredicateAsExpression, supportsRecursiveCTE, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsSkipLocked, supportsStandardArrays, supportsStandardCurrentTimestampFunction, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsUnionAll, supportsUnionInSubquery, supportsValuesList, supportsWait, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, translateExtractField, trimPattern, useArrayForMultiValuedParameters, useFollowOnLocking, useInputStreamToInsertBlob, useMaterializedLobWhenCapacityExceeded
-
-
-
-
Constructor Detail
-
HANAColumnStoreDialect
public HANAColumnStoreDialect(DialectResolutionInfo info)
-
HANAColumnStoreDialect
public HANAColumnStoreDialect()
-
HANAColumnStoreDialect
public HANAColumnStoreDialect(DatabaseVersion version)
-
-
Method Detail
-
isUseUnicodeStringTypes
public boolean isUseUnicodeStringTypes()
- Overrides:
isUseUnicodeStringTypes
in classAbstractHANADialect
-
getMaxVarcharLength
public int getMaxVarcharLength()
Description copied from class:Dialect
The 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:
getMaxVarcharLength
in classAbstractHANADialect
-
registerDefaultKeywords
protected void registerDefaultKeywords()
Description copied from class:Dialect
Register the reserved words of ANSI-standard SQL as keywords.- Overrides:
registerDefaultKeywords
in classAbstractHANADialect
- See Also:
AnsiSqlKeywords
-
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])
-
pi
-
log10(arg)
-
log(base, arg)
-
sign(arg)
-
sin(arg)
-
cos(arg)
-
tan(arg)
-
asin(arg)
-
acos(arg)
-
atan(arg)
-
atan2(arg0, arg1)
-
round(arg0[, arg1])
-
truncate(arg0[, arg1])
-
sinh(arg)
-
tanh(arg)
-
cosh(arg)
-
least(arg0, arg1, ...)
-
greatest(arg0, arg1, ...)
-
degrees(arg)
-
radians(arg)
-
format(datetime as pattern)
-
collate(string as collation)
-
str(arg)
- synonym 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 classAbstractHANADialect
-
-
getCreateTableString
public String getCreateTableString()
Description copied from class:Dialect
The command used to create a table, usuallycreate table
.- Overrides:
getCreateTableString
in classDialect
- Returns:
- The command used to create a table.
-
getFallbackSqmMutationStrategy
public SqmMultiTableMutationStrategy getFallbackSqmMutationStrategy(EntityMappingType entityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext)
Description copied from class:Dialect
TheSqmMultiTableMutationStrategy
to use when not specified byQueryEngineOptions.getCustomSqmMultiTableMutationStrategy()
.
-
getFallbackSqmInsertStrategy
public SqmMultiTableInsertStrategy getFallbackSqmInsertStrategy(EntityMappingType entityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext)
Description copied from class:Dialect
TheSqmMultiTableInsertStrategy
to use when not specified byQueryEngineOptions.getCustomSqmMultiTableInsertStrategy()
.
-
getSupportedTemporaryTableKind
public TemporaryTableKind getSupportedTemporaryTableKind()
Description copied from class:Dialect
The kind of temporary tables that are supported on this database.- Overrides:
getSupportedTemporaryTableKind
in classDialect
-
getTemporaryTableCreateOptions
public String getTemporaryTableCreateOptions()
Description copied from class:Dialect
An arbitrary SQL fragment appended to the end of the statement to create a temporary table, specifying dialect-specific options, ornull
if there are no options to specify.- Overrides:
getTemporaryTableCreateOptions
in classDialect
-
getTemporaryTableCreateCommand
public String getTemporaryTableCreateCommand()
Description copied from class:Dialect
The command to create a temporary table.- Overrides:
getTemporaryTableCreateCommand
in classDialect
-
getTemporaryTableTruncateCommand
public String getTemporaryTableTruncateCommand()
Description copied from class:Dialect
The command to truncate a temporary table.- Overrides:
getTemporaryTableTruncateCommand
in classDialect
-
supportsAsciiStringTypes
protected boolean supportsAsciiStringTypes()
- Specified by:
supportsAsciiStringTypes
in classAbstractHANADialect
-
useUnicodeStringTypesDefault
protected Boolean useUnicodeStringTypesDefault()
- Specified by:
useUnicodeStringTypesDefault
in classAbstractHANADialect
-
-