Package org.hibernate.dialect
Class PostgresPlusDialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.PostgreSQLDialect
-
- org.hibernate.dialect.PostgresPlusDialect
-
- All Implemented Interfaces:
ConversionContext
public class PostgresPlusDialect extends PostgreSQLDialect
An SQL dialect for Postgres Plus
-
-
Nested Class Summary
-
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, NEW_LOCATOR_LOB_MERGE_STRATEGY, QUOTE, STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description PostgresPlusDialect()Constructs a PostgresPlusDialectPostgresPlusDialect(DatabaseVersion version)PostgresPlusDialect(DialectResolutionInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcastPattern(CastType from, CastType to)Obtain a pattern for the SQL equivalent to acast()function call.StringgetCurrentTimestampSelectString()Retrieve the command used to retrieve the current timestamp from the database.ResultSetgetResultSet(CallableStatement ps)Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the OUT parameter.StringgetSelectGUIDString()Get the command used to select a GUID from the underlying database.voidinitializeFunctionRegistry(QueryEngine queryEngine)Initialize the given registry with any dialect-specific functions.intregisterResultSetOutParameter(CallableStatement statement, int col)Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet*by position*.StringtimestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType)Obtain a pattern for the SQL equivalent to atimestampdiff()function call.-
Methods inherited from class org.hibernate.dialect.PostgreSQLDialect
appendBinaryLiteral, appendBooleanValueString, appendDatetimeFormat, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, augmentRecognizedTableTypes, buildIdentifierHelper, buildSQLExceptionConversionDelegate, columnType, contributeTypes, currentTime, currentTimestamp, currentTimestampWithTimeZone, datetimeFormat, extractField, extractPattern, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCurrentSchemaCommand, getDefaultNonContextualLobCreation, getDefaultStatementBatchSize, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getFractionalSecondPrecisionInNanos, getGroupBySelectItemReferenceStrategy, getIdentityColumnSupport, getLimitHandler, getMaxIdentifierLength, getMaxVarbinaryLength, getMaxVarcharLength, getNameQualifierSupport, getNationalizationSupport, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getQuerySequencesString, getReadLockString, getReadLockString, getResultSet, getResultSet, getSelectClauseNullString, getSequenceSupport, getSqlAstTranslatorFactory, getSupportedJdbcTypeCodes, getTimeZoneSupport, getTypeName, getViolatedConstraintNameExtractor, getWriteLockString, getWriteLockString, getWriteRowLockStrategy, isCurrentTimestampSelectStringCallable, qualifyIndexName, requiresParensForTupleDistinctCounts, resolveSqlTypeDescriptor, supportsCaseInsensitiveLike, supportsCommentOn, supportsCurrentTimestampSelection, supportsFetchClause, supportsIfExistsAfterAlterTable, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsJdbcConnectionLobCreation, supportsLateral, supportsLobValueChangePropagation, supportsNonQueryWithCTE, supportsNoWait, supportsOffsetInSubquery, supportsOuterJoinForUpdate, supportsPartitionBy, supportsSkipLocked, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsValuesList, supportsWait, supportsWindowFunctions, timestampaddPattern, translateExtractField, useInputStreamToInsertBlob
-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendIntervalLiteral, appendLiteral, appendLockHint, applyLocksToSql, beforeRegisteringColumnTypes, beforeRegisteringColumnTypes, binaryToDecimalPrecision, canCreateCatalog, canCreateSchema, closeQuote, currentDate, currentLocalTime, currentLocalTimestamp, defaultScrollMode, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, dropConstraints, equivalentTypes, escapeComment, forceLobAsLastValue, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getBooleanCheckCondition, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getDefaultBatchLoadSizingStrategy, getDefaultDecimalPrecision, getDefaultLobLength, getDefaultProperties, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDefaultUseStreamsForBinary, getDoublePrecision, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropTableString, getEnumCheckCondition, getFloatPrecision, getForeignKeyExporter, getForUpdateString, getForUpdateString, getForUpdateString, getHibernateTypeName, getHibernateTypeName, getHqlTranslator, getIndexExporter, getInExpressionCountLimit, getKeywords, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxAliasLength, getMaxNVarcharLength, getNullColumnString, getNullColumnString, getNullOrdering, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getQueryHintString, getRawTypeName, getRawTypeName, getReadRowLockStrategy, getSchemaNameResolver, getSequenceExporter, getSequenceInformationExtractor, getSizeStrategy, getSqmTranslatorFactory, getSupportedTemporaryTableKind, getTableComment, getTableExporter, getTableTypeString, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableDropCommand, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTypeName, getTypeName, getTypeName, getUniqueDelegate, getUniqueKeyExporter, getVersion, hasAlterTable, hasSelfReferentialForeignKeyBug, initDefaultProperties, inlineLiteral, isAnsiNullOn, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, quote, registerColumnType, registerColumnType, registerDefaultColumnTypes, registerDefaultColumnTypes, registerDefaultKeywords, registerHibernateType, registerHibernateType, registerHibernateTypes, registerKeyword, registerKeywords, registerResultSetOutParameter, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, resolveSqlTypeLength, supportsBindAsCallableArgument, supportsBitType, supportsCascadeDelete, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsFractionalTimestampArithmetic, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsLockTimeouts, supportsNamedParameters, supportsNoColumnsInsert, supportsNullPrecedence, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsParametersInInsertSelect, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleDistinctCounts, supportsUnionAll, supportsUnionInSubquery, supportsValuesListForInsert, toBooleanValueString, toString, transformSelectString, translateDurationField, trimPattern, useFollowOnLocking
-
-
-
-
Constructor Detail
-
PostgresPlusDialect
public PostgresPlusDialect()
Constructs a PostgresPlusDialect
-
PostgresPlusDialect
public PostgresPlusDialect(DialectResolutionInfo info)
-
PostgresPlusDialect
public PostgresPlusDialect(DatabaseVersion version)
-
-
Method Detail
-
initializeFunctionRegistry
public void initializeFunctionRegistry(QueryEngine queryEngine)
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
- 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])
- 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])
- sign(arg)
- sin(arg)
- cos(arg)
- tan(arg)
- asin(arg)
- acos(arg)
- atan(arg)
- atan2(arg0, arg1)
- round(arg0, arg1)
- least(arg0, arg1, ...)
- greatest(arg0, arg1, ...)
- format(datetime as pattern)
- str(arg) - synonym of cast(a as String)
- ifnull(arg0, arg1) - synonym of coalesce(a, b)
- second(arg) - synonym of extract(second from a)
- minute(arg) - synonym of extract(minute from a)
- hour(arg) - synonym of extract(hour from a)
- day(arg) - synonym of extract(day from a)
- month(arg) - synonym of extract(month from a)
- year(arg) - synonym of extract(year from a)
- Overrides:
initializeFunctionRegistryin classPostgreSQLDialect
-
castPattern
public String castPattern(CastType from, CastType to)
Description copied from class:DialectObtain a pattern for the SQL equivalent to acast()function call. The resulting pattern must contain ?1 and ?2 placeholders for the arguments.- Overrides:
castPatternin classDialect- Parameters:
from- aCastTypeindicating the type of the value argumentto- aCastTypeindicating the type the value argument is cast to
-
getCurrentTimestampSelectString
public String getCurrentTimestampSelectString()
Description copied from class:DialectRetrieve the command used to retrieve the current timestamp from the database.- Overrides:
getCurrentTimestampSelectStringin classPostgreSQLDialect- Returns:
- The command.
-
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 classPostgreSQLDialect- Parameters:
unit- the first argumentfromTemporalType- true if the first argument is a timestamp, false if a datetoTemporalType- true if the second argument is
-
registerResultSetOutParameter
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException
Description copied from class:DialectRegisters a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet*by position*. Pre-Java 8, registering such ResultSet-returning parameters varied greatly across database and drivers; hence its inclusion as part of the Dialect contract.- Overrides:
registerResultSetOutParameterin classPostgreSQLDialect- 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
public ResultSet getResultSet(CallableStatement ps) throws SQLException
Description copied from class:DialectGiven a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the OUT parameter.- Overrides:
getResultSetin classPostgreSQLDialect- Parameters:
ps- The callable statement.- Returns:
- The extracted result set.
- Throws:
SQLException- Indicates problems extracting the result set.
-
getSelectGUIDString
public String getSelectGUIDString()
Description copied from class:DialectGet the command used to select a GUID from the underlying database. Optional operation.- Overrides:
getSelectGUIDStringin classDialect- Returns:
- The appropriate command.
-
-