parent
10d759e139
commit
942dd7283f
|
@ -175,7 +175,7 @@ public class FirebirdDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public TimeZoneSupport getTimeZoneSupport() {
|
||||
return getVersion().isSince( 4, 0 ) ? TimeZoneSupport.NATIVE : TimeZoneSupport.NONE;
|
||||
return getVersion().isSameOrAfter( 4, 0 ) ? TimeZoneSupport.NATIVE : TimeZoneSupport.NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -247,7 +247,7 @@ public class FirebirdDialect extends Dialect {
|
|||
CommonFunctionFactory.cosh( queryEngine );
|
||||
CommonFunctionFactory.sinh( queryEngine );
|
||||
CommonFunctionFactory.tanh( queryEngine );
|
||||
if ( getVersion().isSince( 3, 0 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 3, 0 ) ) {
|
||||
CommonFunctionFactory.moreHyperbolic( queryEngine );
|
||||
CommonFunctionFactory.stddevPopSamp( queryEngine );
|
||||
CommonFunctionFactory.varPopSamp( queryEngine );
|
||||
|
@ -301,7 +301,7 @@ public class FirebirdDialect extends Dialect {
|
|||
doubleType
|
||||
);
|
||||
|
||||
if ( getVersion().isSince( 4, 0 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 4, 0 ) ) {
|
||||
Arrays.asList( "md5", "sha1", "sha256", "sha512" )
|
||||
.forEach( hash -> functionRegistry.registerPattern(
|
||||
hash,
|
||||
|
@ -464,7 +464,7 @@ public class FirebirdDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsTemporalLiteralOffset() {
|
||||
return getVersion().isSince( 4, 0 );
|
||||
return getVersion().isSameOrAfter( 4, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -501,7 +501,7 @@ public class FirebirdDialect extends Dialect {
|
|||
// Additional reserved words
|
||||
// The Hibernate list of SQL:2003 reserved words doesn't contain all SQL:2003 reserved words,
|
||||
// and Firebird is finicky when it comes to reserved words
|
||||
if ( version.isSince( 3, 0 ) ) {
|
||||
if ( version.isSameOrAfter( 3, 0 ) ) {
|
||||
builder.applyReservedWords(
|
||||
"AVG", "BOOLEAN", "CHARACTER_LENGTH", "CHAR_LENGTH", "CORR", "COUNT",
|
||||
"COVAR_POP", "COVAR_SAMP", "EXTRACT", "LOWER", "MAX", "MIN", "OCTET_LENGTH", "POSITION",
|
||||
|
@ -541,7 +541,7 @@ public class FirebirdDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsCommentOn() {
|
||||
return getVersion().isSince( 2, 0 );
|
||||
return getVersion().isSameOrAfter( 2, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -569,18 +569,18 @@ public class FirebirdDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsExistsInSelect() {
|
||||
return getVersion().isSince( 3, 0 );
|
||||
return getVersion().isSameOrAfter( 3, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsPartitionBy() {
|
||||
return getVersion().isSince( 3, 0 );
|
||||
return getVersion().isSameOrAfter( 3, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendBooleanValueString(SqlAppender appender, boolean bool) {
|
||||
//'boolean' type introduced in 3.0
|
||||
if ( getVersion().isSince( 3, 0 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 3, 0 ) ) {
|
||||
appender.appendSql( bool ? '1' : '0' );
|
||||
}
|
||||
else {
|
||||
|
@ -675,12 +675,12 @@ public class FirebirdDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public NullOrdering getNullOrdering() {
|
||||
return getVersion().isSince( 2, 0 ) ? NullOrdering.SMALLEST : NullOrdering.LAST;
|
||||
return getVersion().isSameOrAfter( 2, 0 ) ? NullOrdering.SMALLEST : NullOrdering.LAST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsNullPrecedence() {
|
||||
return getVersion().isSince( 1, 5 );
|
||||
return getVersion().isSameOrAfter( 1, 5 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -695,7 +695,7 @@ public class FirebirdDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsWindowFunctions() {
|
||||
return getVersion().isSince( 3, 0 );
|
||||
return getVersion().isSameOrAfter( 3, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -117,7 +117,7 @@ public class InformixDialect extends Dialect {
|
|||
//according to the Informix documentation for
|
||||
//version 11 and above, parameters are supported
|
||||
//but I have not tested this at all!
|
||||
: new SkipFirstLimitHandler( getVersion().isSince( 11 ) );
|
||||
: new SkipFirstLimitHandler( getVersion().isSameOrAfter( 11 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -140,7 +140,7 @@ public class IngresDialect extends Dialect {
|
|||
//note: 'long nvarchar' is a synonym for 'nclob'
|
||||
registerColumnType( Types.NVARCHAR, "long nvarchar($l)" );
|
||||
|
||||
if ( getVersion().isSince( 9, 3 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 9, 3 ) ) {
|
||||
// Not completely necessary, given that Ingres
|
||||
// can be configured to set DATE = ANSIDATE
|
||||
registerColumnType( Types.DATE, "ansidate" );
|
||||
|
@ -170,7 +170,7 @@ public class IngresDialect extends Dialect {
|
|||
sequenceSupport = new ANSISequenceSupport() {
|
||||
@Override
|
||||
public boolean supportsPooledSequences() {
|
||||
return getVersion().isSince( 9, 3 );
|
||||
return getVersion().isSameOrAfter( 9, 3 );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -375,10 +375,10 @@ public class IngresDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public IdentityColumnSupport getIdentityColumnSupport() {
|
||||
if ( getVersion().isSince( 10 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 10 ) ) {
|
||||
return new Ingres10IdentityColumnSupport();
|
||||
}
|
||||
else if ( getVersion().isSince( 9, 3 ) ) {
|
||||
else if ( getVersion().isSameOrAfter( 9, 3 ) ) {
|
||||
return new Ingres9IdentityColumnSupport();
|
||||
}
|
||||
else {
|
||||
|
@ -408,7 +408,7 @@ public class IngresDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsCurrentTimestampSelection() {
|
||||
return getVersion().isSince( 9, 3 );
|
||||
return getVersion().isSameOrAfter( 9, 3 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -460,7 +460,7 @@ public class IngresDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsUnionAll() {
|
||||
return getVersion().isSince( 9, 3 );
|
||||
return getVersion().isSameOrAfter( 9, 3 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -472,7 +472,7 @@ public class IngresDialect extends Dialect {
|
|||
@Override
|
||||
public boolean supportsSubqueryInSelect() {
|
||||
// At least according to HHH-4961
|
||||
return getVersion().isSince( 10 );
|
||||
return getVersion().isSameOrAfter( 10 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -485,12 +485,12 @@ public class IngresDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean doesReadCommittedCauseWritersToBlockReaders() {
|
||||
return getVersion().isSince( 9, 3 );
|
||||
return getVersion().isSameOrAfter( 9, 3 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesRepeatableReadCauseReadersToBlockWriters() {
|
||||
return getVersion().isSince( 9, 3 );
|
||||
return getVersion().isSameOrAfter( 9, 3 );
|
||||
}
|
||||
|
||||
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -528,6 +528,6 @@ public class IngresDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsFetchClause(FetchClauseType type) {
|
||||
return getVersion().isSince( 9, 3 );
|
||||
return getVersion().isSameOrAfter( 9, 3 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -359,7 +359,7 @@ public class SQLiteDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsNullPrecedence() {
|
||||
return getVersion().isSince( 3, 3 );
|
||||
return getVersion().isSameOrAfter( 3, 3 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -258,7 +258,7 @@ public class TeradataDialect extends Dialect {
|
|||
.setExactArgumentCount( 2 )
|
||||
.register();
|
||||
|
||||
if ( getVersion().isSince( 14 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 14 ) ) {
|
||||
|
||||
//list actually taken from Teradata 15 docs
|
||||
CommonFunctionFactory.lastDay( queryEngine );
|
||||
|
@ -515,7 +515,7 @@ public class TeradataDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean useFollowOnLocking(String sql, QueryOptions queryOptions) {
|
||||
return getVersion().isSince( 14 );
|
||||
return getVersion().isSameOrAfter( 14 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -115,7 +115,7 @@ public class CockroachDialect extends Dialect {
|
|||
registerColumnType( SqlTypes.INTERVAL_SECOND, "interval second($s)" );
|
||||
|
||||
// Prefer jsonb if possible
|
||||
if ( getVersion().isSince( 20, 0 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 20, 0 ) ) {
|
||||
registerColumnType( SqlTypes.INET, "inet" );
|
||||
registerColumnType( SqlTypes.JSON, "jsonb" );
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ public class CockroachDialect extends Dialect {
|
|||
jdbcTypeRegistry.addDescriptorIfAbsent( UUIDJdbcType.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLIntervalSecondJdbcType.INSTANCE );
|
||||
|
||||
if ( getVersion().isSince( 20, 0 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 20, 0 ) ) {
|
||||
jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLInetJdbcType.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLJsonbJdbcType.INSTANCE );
|
||||
}
|
||||
|
@ -664,7 +664,7 @@ public class CockroachDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsNoWait() {
|
||||
return getVersion().isSince( 20, 1 );
|
||||
return getVersion().isSameOrAfter( 20, 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -674,12 +674,12 @@ public class CockroachDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsSkipLocked() {
|
||||
return getVersion().isSince( 20, 1 );
|
||||
return getVersion().isSameOrAfter( 20, 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public RowLockStrategy getWriteRowLockStrategy() {
|
||||
return getVersion().isSince( 20, 1 ) ? RowLockStrategy.TABLE : RowLockStrategy.NONE;
|
||||
return getVersion().isSameOrAfter( 20, 1 ) ? RowLockStrategy.TABLE : RowLockStrategy.NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -376,7 +376,7 @@ public class DB2Dialect extends Dialect {
|
|||
@Override
|
||||
public boolean supportsSkipLocked() {
|
||||
// Introduced in 11.5: https://www.ibm.com/docs/en/db2/11.5?topic=statement-concurrent-access-resolution-clause
|
||||
return getVersion().isSince( 11, 5 );
|
||||
return getVersion().isSameOrAfter( 11, 5 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -51,7 +51,7 @@ public class DB2SqlAstTranslator<T extends JdbcOperation> extends AbstractSqlAst
|
|||
|
||||
@Override
|
||||
public void visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate) {
|
||||
if ( getDialect().getVersion().isSince( 11 ) ) {
|
||||
if ( getDialect().getVersion().isSameOrAfter( 11 ) ) {
|
||||
booleanExpressionPredicate.getExpression().accept( this );
|
||||
}
|
||||
else {
|
||||
|
@ -137,7 +137,7 @@ public class DB2SqlAstTranslator<T extends JdbcOperation> extends AbstractSqlAst
|
|||
}
|
||||
|
||||
protected boolean supportsOffsetClause() {
|
||||
return getDialect().getVersion().isSince( 11, 1 );
|
||||
return getDialect().getVersion().isSameOrAfter( 11, 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -228,7 +228,7 @@ public class DB2SqlAstTranslator<T extends JdbcOperation> extends AbstractSqlAst
|
|||
|
||||
@Override
|
||||
protected void renderComparison(Expression lhs, ComparisonOperator operator, Expression rhs) {
|
||||
if ( getDialect().getVersion().isSince( 11, 1 ) ) {
|
||||
if ( getDialect().getVersion().isSameOrAfter( 11, 1 ) ) {
|
||||
renderComparisonStandard( lhs, operator, rhs );
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -69,6 +69,33 @@ public interface DatabaseVersion {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simpler naming
|
||||
*
|
||||
* @see #getDatabaseMajorVersion()
|
||||
*/
|
||||
default int getMajor() {
|
||||
return getDatabaseMajorVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Simpler naming
|
||||
*
|
||||
* @see #getDatabaseMinorVersion()
|
||||
*/
|
||||
default int getMinor() {
|
||||
return getDatabaseMinorVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Simpler naming
|
||||
*
|
||||
* @see #getDatabaseMicroVersion()
|
||||
*/
|
||||
default int getMicro() {
|
||||
return getDatabaseMicroVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a simple copy of this version object
|
||||
*/
|
||||
|
@ -115,15 +142,15 @@ public interface DatabaseVersion {
|
|||
/**
|
||||
* {@link #isSame} or {@link #isAfter}
|
||||
*/
|
||||
default boolean isSince(DatabaseVersion other) {
|
||||
return isSince( other.getDatabaseMajorVersion(), other.getDatabaseMinorVersion() );
|
||||
default boolean isSameOrAfter(DatabaseVersion other) {
|
||||
return isSameOrAfter( other.getDatabaseMajorVersion(), other.getDatabaseMinorVersion() );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link #isSame} or {@link #isAfter}
|
||||
*/
|
||||
default boolean isSince(Integer otherMajor, Integer otherMinor) {
|
||||
return isSince(
|
||||
default boolean isSameOrAfter(Integer otherMajor, Integer otherMinor) {
|
||||
return isSameOrAfter(
|
||||
(int) otherMajor,
|
||||
otherMinor == null ? NO_VERSION : otherMinor
|
||||
);
|
||||
|
@ -132,7 +159,7 @@ public interface DatabaseVersion {
|
|||
/**
|
||||
* {@link #isSame} or {@link #isAfter}
|
||||
*/
|
||||
default boolean isSince(int otherMajor) {
|
||||
default boolean isSameOrAfter(int otherMajor) {
|
||||
final int major = getDatabaseMajorVersion();
|
||||
|
||||
return major >= otherMajor;
|
||||
|
@ -141,7 +168,7 @@ public interface DatabaseVersion {
|
|||
/**
|
||||
* {@link #isSame} or {@link #isAfter}
|
||||
*/
|
||||
default boolean isSince(int otherMajor, int otherMinor) {
|
||||
default boolean isSameOrAfter(int otherMajor, int otherMinor) {
|
||||
final int major = getDatabaseMajorVersion();
|
||||
final int minor = getDatabaseMinorVersion();
|
||||
|
||||
|
@ -152,7 +179,7 @@ public interface DatabaseVersion {
|
|||
/**
|
||||
* {@link #isSame} or {@link #isAfter}
|
||||
*/
|
||||
default boolean isSince(int otherMajor, int otherMinor, int otherMicro) {
|
||||
default boolean isSameOrAfter(int otherMajor, int otherMinor, int otherMicro) {
|
||||
final int major = getDatabaseMajorVersion();
|
||||
final int minor = getDatabaseMinorVersion();
|
||||
final int micro = getDatabaseMicroVersion();
|
||||
|
@ -215,14 +242,14 @@ public interface DatabaseVersion {
|
|||
* Determine whether this version before the passed one
|
||||
*/
|
||||
default boolean isBefore(int major, int minor) {
|
||||
return ! isSince( major, minor );
|
||||
return ! isSameOrAfter( major, minor );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether this version before the passed one
|
||||
*/
|
||||
default boolean isBefore(int major) {
|
||||
return ! isSince( major );
|
||||
return ! isSameOrAfter( major );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -236,18 +263,6 @@ public interface DatabaseVersion {
|
|||
* Determine whether this version before the passed one
|
||||
*/
|
||||
default boolean isBefore(int otherMajor, int otherMinor, int otherMicro) {
|
||||
return ! isSince( otherMajor, otherMinor, otherMicro );
|
||||
}
|
||||
|
||||
default int getMajor() {
|
||||
return getDatabaseMajorVersion();
|
||||
}
|
||||
|
||||
default int getMinor() {
|
||||
return getDatabaseMinorVersion();
|
||||
}
|
||||
|
||||
default int getMicro() {
|
||||
return getDatabaseMicroVersion();
|
||||
return ! isSameOrAfter( otherMajor, otherMinor, otherMicro );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ public class DerbyDialect extends Dialect {
|
|||
|
||||
limitHandler = getVersion().isBefore( 10, 5 )
|
||||
? AbstractLimitHandler.NO_LIMIT
|
||||
: new DerbyLimitHandler( getVersion().isSince( 10, 6 ) );
|
||||
: new DerbyLimitHandler( getVersion().isSameOrAfter( 10, 6 ) );
|
||||
|
||||
getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, NO_BATCH );
|
||||
}
|
||||
|
@ -854,6 +854,6 @@ public class DerbyDialect extends Dialect {
|
|||
@Override
|
||||
public boolean supportsWindowFunctions() {
|
||||
// It seems at least the row_number function is supported as of 10.4
|
||||
return getVersion().isSince( 10, 4 );
|
||||
return getVersion().isSameOrAfter( 10, 4 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -259,12 +259,12 @@ public class DerbySqlAstTranslator<T extends JdbcOperation> extends AbstractSqlA
|
|||
}
|
||||
|
||||
private boolean supportsParameterOffsetFetchExpression() {
|
||||
return getDialect().getVersion().isSince( 10, 6 );
|
||||
return getDialect().getVersion().isSameOrAfter( 10, 6 );
|
||||
}
|
||||
|
||||
private boolean supportsOffsetFetchClause() {
|
||||
// Before version 10.5 Derby didn't support OFFSET and FETCH
|
||||
return getDialect().getVersion().isSince( 10, 5 );
|
||||
return getDialect().getVersion().isSameOrAfter( 10, 5 );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ public class H2Dialect extends Dialect {
|
|||
super();
|
||||
this.version = version;
|
||||
// https://github.com/h2database/h2database/commit/b2cdf84e0b84eb8a482fa7dccdccc1ab95241440
|
||||
limitHandler = version.isSince( 1, 4, 195 )
|
||||
limitHandler = version.isSameOrAfter( 1, 4, 195 )
|
||||
? OffsetFetchLimitHandler.INSTANCE
|
||||
: LimitOffsetLimitHandler.INSTANCE;
|
||||
|
||||
|
@ -118,27 +118,27 @@ public class H2Dialect extends Dialect {
|
|||
LOG.unsupportedMultiTableBulkHqlJpaql( version.getMajor(), version.getMinor(), version.getMicro() );
|
||||
}
|
||||
|
||||
supportsTuplesInSubqueries = version.isSince( 1, 4, 198 );
|
||||
supportsTuplesInSubqueries = version.isSameOrAfter( 1, 4, 198 );
|
||||
// Prior to 1.4.200 the 'cascade' in 'drop table' was implicit
|
||||
cascadeConstraints = version.isSince( 1, 4, 200 );
|
||||
cascadeConstraints = version.isSameOrAfter( 1, 4, 200 );
|
||||
// 1.4.200 introduced changes in current_time and current_timestamp
|
||||
useLocalTime = version.isSince( 1, 4, 200 );
|
||||
useLocalTime = version.isSameOrAfter( 1, 4, 200 );
|
||||
|
||||
getDefaultProperties().setProperty( AvailableSettings.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE );
|
||||
// http://code.google.com/p/h2database/issues/detail?id=235
|
||||
getDefaultProperties().setProperty( AvailableSettings.NON_CONTEXTUAL_LOB_CREATION, "true" );
|
||||
|
||||
registerColumnType( SqlTypes.ARRAY, "array" );
|
||||
if ( version.isSince( 1, 4, 32 ) ) {
|
||||
this.sequenceInformationExtractor = version.isSince( 1, 4, 201 )
|
||||
if ( version.isSameOrAfter( 1, 4, 32 ) ) {
|
||||
this.sequenceInformationExtractor = version.isSameOrAfter( 1, 4, 201 )
|
||||
? SequenceInformationExtractorLegacyImpl.INSTANCE
|
||||
: SequenceInformationExtractorH2DatabaseImpl.INSTANCE;
|
||||
this.querySequenceString = "select * from INFORMATION_SCHEMA.SEQUENCES";
|
||||
registerColumnType( Types.DECIMAL, "numeric($p,$s)" );
|
||||
if ( version.isSince( 1, 4, 197 ) ) {
|
||||
if ( version.isSameOrAfter( 1, 4, 197 ) ) {
|
||||
registerColumnType( SqlTypes.UUID, "uuid" );
|
||||
registerColumnType( SqlTypes.GEOMETRY, "geometry" );
|
||||
if ( version.isSince( 1, 4, 198 ) ) {
|
||||
if ( version.isSameOrAfter( 1, 4, 198 ) ) {
|
||||
registerColumnType( SqlTypes.INTERVAL_SECOND, "interval second($p,$s)" );
|
||||
}
|
||||
}
|
||||
|
@ -161,9 +161,9 @@ public class H2Dialect extends Dialect {
|
|||
final JdbcTypeRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration()
|
||||
.getJdbcTypeDescriptorRegistry();
|
||||
|
||||
if ( version.isSince( 1, 4, 197 ) ) {
|
||||
if ( version.isSameOrAfter( 1, 4, 197 ) ) {
|
||||
jdbcTypeRegistry.addDescriptorIfAbsent( UUIDJdbcType.INSTANCE );
|
||||
if ( version.isSince( 1, 4, 198 ) ) {
|
||||
if ( version.isSameOrAfter( 1, 4, 198 ) ) {
|
||||
jdbcTypeRegistry.addDescriptorIfAbsent( DurationIntervalSecondJdbcType.INSTANCE );
|
||||
}
|
||||
}
|
||||
|
@ -499,7 +499,7 @@ public class H2Dialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsFetchClause(FetchClauseType type) {
|
||||
return getVersion().isSince( 1, 4, 198 );
|
||||
return getVersion().isSameOrAfter( 1, 4, 198 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -119,12 +119,12 @@ public class H2SqlAstTranslator<T extends JdbcOperation> extends AbstractSqlAstT
|
|||
}
|
||||
|
||||
private boolean supportsOffsetFetchClause() {
|
||||
return getDialect().getVersion().isSince( 1, 4, 195 );
|
||||
return getDialect().getVersion().isSameOrAfter( 1, 4, 195 );
|
||||
}
|
||||
|
||||
private boolean supportsOffsetFetchClausePercentWithTies() {
|
||||
// Introduction of TIES clause https://github.com/h2database/h2database/commit/876e9fbe7baf11d01675bfe871aac2cf1b6104ce
|
||||
// Introduction of PERCENT support https://github.com/h2database/h2database/commit/f45913302e5f6ad149155a73763c0c59d8205849
|
||||
return getDialect().getVersion().isSince( 1, 4, 198 );
|
||||
return getDialect().getVersion().isSameOrAfter( 1, 4, 198 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public class HANAColumnStoreDialect extends AbstractHANADialect {
|
|||
|
||||
public HANAColumnStoreDialect(DatabaseVersion version) {
|
||||
super( version );
|
||||
if ( version.isSince( 4 ) ) {
|
||||
if ( version.isSameOrAfter( 4 ) ) {
|
||||
registerColumnType( Types.CHAR, "nvarchar(1)" );
|
||||
registerColumnType( Types.VARCHAR, 5000, "nvarchar($l)" );
|
||||
registerColumnType( Types.LONGVARCHAR, 5000, "nvarchar($l)" );
|
||||
|
@ -174,7 +174,7 @@ public class HANAColumnStoreDialect extends AbstractHANADialect {
|
|||
|
||||
@Override
|
||||
protected boolean supportsAsciiStringTypes() {
|
||||
if ( version.isSince( 4 ) ) {
|
||||
if ( version.isSameOrAfter( 4 ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -182,7 +182,7 @@ public class HANAColumnStoreDialect extends AbstractHANADialect {
|
|||
|
||||
@Override
|
||||
protected Boolean useUnicodeStringTypesDefault() {
|
||||
if ( version.isSince( 4 ) ) {
|
||||
if ( version.isSameOrAfter( 4 ) ) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
|
@ -190,7 +190,7 @@ public class HANAColumnStoreDialect extends AbstractHANADialect {
|
|||
|
||||
@Override
|
||||
public boolean isUseUnicodeStringTypes() {
|
||||
if ( version.isSince( 4 ) ) {
|
||||
if ( version.isSameOrAfter( 4 ) ) {
|
||||
return true;
|
||||
}
|
||||
return super.isUseUnicodeStringTypes();
|
||||
|
|
|
@ -128,7 +128,7 @@ public class HSQLDialect extends Dialect {
|
|||
registerColumnType( Types.CLOB, "longvarchar" );
|
||||
}
|
||||
|
||||
if ( this.version.isSince( 2, 5 ) ) {
|
||||
if ( this.version.isSameOrAfter( 2, 5 ) ) {
|
||||
registerKeyword( "period" );
|
||||
}
|
||||
|
||||
|
@ -208,13 +208,13 @@ public class HSQLDialect extends Dialect {
|
|||
CommonFunctionFactory.addMonths( queryEngine );
|
||||
CommonFunctionFactory.monthsBetween( queryEngine );
|
||||
|
||||
if ( version.isSince( 2 ) ) {
|
||||
if ( version.isSameOrAfter( 2 ) ) {
|
||||
//SYSDATE is similar to LOCALTIMESTAMP but it returns the timestamp when it is called
|
||||
CommonFunctionFactory.sysdate( queryEngine );
|
||||
}
|
||||
|
||||
// from v. 2.2.0 ROWNUM() is supported in all modes as the equivalent of Oracle ROWNUM
|
||||
if ( version.isSince( 2, 2 ) ) {
|
||||
if ( version.isSameOrAfter( 2, 2 ) ) {
|
||||
CommonFunctionFactory.rownum( queryEngine );
|
||||
}
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ public class HSQLDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public String getForUpdateString() {
|
||||
if ( version.isSince( 2 ) ) {
|
||||
if ( version.isSameOrAfter( 2 ) ) {
|
||||
return " for update";
|
||||
}
|
||||
else {
|
||||
|
@ -387,7 +387,7 @@ public class HSQLDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsColumnCheck() {
|
||||
return version.isSince( 2 );
|
||||
return version.isSameOrAfter( 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -676,19 +676,19 @@ public class HSQLDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsCommentOn() {
|
||||
return version.isSince( 2 );
|
||||
return version.isSameOrAfter( 2 );
|
||||
}
|
||||
|
||||
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@Override
|
||||
public boolean doesReadCommittedCauseWritersToBlockReaders() {
|
||||
return version.isSince( 2 );
|
||||
return version.isSameOrAfter( 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesRepeatableReadCauseReadersToBlockWriters() {
|
||||
return version.isSince( 2 );
|
||||
return version.isSameOrAfter( 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -709,7 +709,7 @@ public class HSQLDialect extends Dialect {
|
|||
@Override
|
||||
public boolean supportsTupleDistinctCounts() {
|
||||
// from v. 2.2.9 is added support for COUNT(DISTINCT ...) with multiple arguments
|
||||
return version.isSince( 2, 2, 9 );
|
||||
return version.isSameOrAfter( 2, 2, 9 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -215,6 +215,6 @@ public class HSQLSqlAstTranslator<T extends JdbcOperation> extends AbstractSqlAs
|
|||
}
|
||||
|
||||
private boolean supportsOffsetFetchClause() {
|
||||
return getDialect().getVersion().isSince( 2, 5 );
|
||||
return getDialect().getVersion().isSameOrAfter( 2, 5 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ public class MariaDBDialect extends MySQLDialect {
|
|||
public void initializeFunctionRegistry(QueryEngine queryEngine) {
|
||||
super.initializeFunctionRegistry(queryEngine);
|
||||
|
||||
if ( getVersion().isSince( 10, 2 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 10, 2 ) ) {
|
||||
queryEngine.getSqmFunctionRegistry().registerNamed(
|
||||
"json_valid",
|
||||
queryEngine.getTypeConfiguration()
|
||||
|
@ -101,12 +101,12 @@ public class MariaDBDialect extends MySQLDialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsWindowFunctions() {
|
||||
return getVersion().isSince( 10, 2 );
|
||||
return getVersion().isSameOrAfter( 10, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsColumnCheck() {
|
||||
return getVersion().isSince( 10, 2 );
|
||||
return getVersion().isSameOrAfter( 10, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -116,12 +116,12 @@ public class MariaDBDialect extends MySQLDialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsIfExistsBeforeConstraintName() {
|
||||
return getVersion().isSince( 10 );
|
||||
return getVersion().isSameOrAfter( 10 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsIfExistsAfterAlterTable() {
|
||||
return getVersion().isSince( 10, 5 );
|
||||
return getVersion().isSameOrAfter( 10, 5 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -148,17 +148,17 @@ public class MariaDBDialect extends MySQLDialect {
|
|||
@Override
|
||||
public boolean supportsSkipLocked() {
|
||||
//only supported on MySQL and as of 10.6
|
||||
return getVersion().isSince( 10, 6 );
|
||||
return getVersion().isSameOrAfter( 10, 6 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsNoWait() {
|
||||
return getVersion().isSince( 10, 3 );
|
||||
return getVersion().isSameOrAfter( 10, 3 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWait() {
|
||||
return getVersion().isSince( 10, 3 );
|
||||
return getVersion().isSameOrAfter( 10, 3 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -120,6 +120,6 @@ public class MariaDBSqlAstTranslator<T extends JdbcOperation> extends AbstractSq
|
|||
}
|
||||
|
||||
private boolean supportsWindowFunctions() {
|
||||
return getDialect().getVersion().isSince( 10, 2 );
|
||||
return getDialect().getVersion().isSameOrAfter( 10, 2 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -408,7 +408,7 @@ public class MySQLDialect extends Dialect {
|
|||
final JdbcTypeRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration()
|
||||
.getJdbcTypeDescriptorRegistry();
|
||||
|
||||
if ( getMySQLVersion().isSince( 5, 7 ) ) {
|
||||
if ( getMySQLVersion().isSameOrAfter( 5, 7 ) ) {
|
||||
jdbcTypeRegistry.addDescriptorIfAbsent( SqlTypes.JSON, JsonJdbcType.INSTANCE );
|
||||
}
|
||||
|
||||
|
@ -549,7 +549,7 @@ public class MySQLDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsUnionAll() {
|
||||
return getMySQLVersion().isSince( 5 );
|
||||
return getMySQLVersion().isSameOrAfter( 5 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1129,17 +1129,17 @@ public class MySQLDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsWindowFunctions() {
|
||||
return getMySQLVersion().isSince( 8, 2 );
|
||||
return getMySQLVersion().isSameOrAfter( 8, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSkipLocked() {
|
||||
return getMySQLVersion().isSince( 8 );
|
||||
return getMySQLVersion().isSameOrAfter( 8 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsNoWait() {
|
||||
return getMySQLVersion().isSince( 8 );
|
||||
return getMySQLVersion().isSameOrAfter( 8 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1154,11 +1154,11 @@ public class MySQLDialect extends Dialect {
|
|||
}
|
||||
|
||||
boolean supportsForShare() {
|
||||
return getMySQLVersion().isSince( 8 );
|
||||
return getMySQLVersion().isSameOrAfter( 8 );
|
||||
}
|
||||
|
||||
boolean supportsAliasLocks() {
|
||||
return getMySQLVersion().isSince( 8 );
|
||||
return getMySQLVersion().isSameOrAfter( 8 );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ public class MySQLSqlAstTranslator<T extends JdbcOperation> extends AbstractSqlA
|
|||
|
||||
@Override
|
||||
protected String getForShare(int timeoutMillis) {
|
||||
return getDialect().getVersion().isSince( 8 ) ? " for share" : " lock in share mode";
|
||||
return getDialect().getVersion().isSameOrAfter( 8 ) ? " for share" : " lock in share mode";
|
||||
}
|
||||
|
||||
protected boolean shouldEmulateFetchClause(QueryPart queryPart) {
|
||||
|
@ -117,7 +117,7 @@ public class MySQLSqlAstTranslator<T extends JdbcOperation> extends AbstractSqlA
|
|||
|
||||
@Override
|
||||
public boolean supportsRowValueConstructorSyntaxInInList() {
|
||||
return getDialect().getVersion().isSince( 5, 7 );
|
||||
return getDialect().getVersion().isSameOrAfter( 5, 7 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -572,7 +572,7 @@ public class OracleDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public TimeZoneSupport getTimeZoneSupport() {
|
||||
return getVersion().isSince( 9 ) ? TimeZoneSupport.NATIVE : TimeZoneSupport.NONE;
|
||||
return getVersion().isSameOrAfter( 9 ) ? TimeZoneSupport.NATIVE : TimeZoneSupport.NONE;
|
||||
}
|
||||
|
||||
protected void registerBinaryTypeMappings() {
|
||||
|
@ -584,7 +584,7 @@ public class OracleDialect extends Dialect {
|
|||
}
|
||||
|
||||
protected void registerExtendedTypeMappings() {
|
||||
if ( getVersion().isSince( 10 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 10 ) ) {
|
||||
registerColumnType( SqlTypes.GEOMETRY, "MDSYS.SDO_GEOMETRY" );
|
||||
}
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ public class OracleDialect extends Dialect {
|
|||
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) {
|
||||
super.contributeTypes( typeContributions, serviceRegistry );
|
||||
|
||||
if ( getVersion().isSince( 12 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 12 ) ) {
|
||||
// account for Oracle's deprecated support for LONGVARBINARY
|
||||
// prefer BLOB, unless the user explicitly opts out
|
||||
boolean preferLong = serviceRegistry.getService( ConfigurationService.class ).getSetting(
|
||||
|
@ -726,7 +726,7 @@ public class OracleDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public String getSelectClauseNullString(int sqlType) {
|
||||
if ( getVersion().isSince( 9 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 9 ) ) {
|
||||
return super.getSelectClauseNullString(sqlType);
|
||||
}
|
||||
else {
|
||||
|
@ -1047,7 +1047,7 @@ public class OracleDialect extends Dialect {
|
|||
public boolean supportsFetchClause(FetchClauseType type) {
|
||||
// Until 12.2 there was a bug in the Oracle query rewriter causing ORA-00918
|
||||
// when the query contains duplicate implicit aliases in the select clause
|
||||
return getVersion().isSince( 12, 2 );
|
||||
return getVersion().isSameOrAfter( 12, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1057,12 +1057,12 @@ public class OracleDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsNoWait() {
|
||||
return getVersion().isSince( 9 );
|
||||
return getVersion().isSameOrAfter( 9 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSkipLocked() {
|
||||
return getVersion().isSince( 10 );
|
||||
return getVersion().isSameOrAfter( 10 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -399,7 +399,7 @@ public class OracleSqlAstTranslator<T extends JdbcOperation> extends AbstractSql
|
|||
|
||||
@Override
|
||||
protected boolean supportsRowValueConstructorSyntaxInInList() {
|
||||
return getDialect().getVersion().isSince( 8, 2 );
|
||||
return getDialect().getVersion().isSameOrAfter( 8, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -409,7 +409,7 @@ public class OracleSqlAstTranslator<T extends JdbcOperation> extends AbstractSql
|
|||
|
||||
@Override
|
||||
protected boolean supportsRowValueConstructorSyntaxInInSubQuery() {
|
||||
return getDialect().getVersion().isSince( 9 );
|
||||
return getDialect().getVersion().isSameOrAfter( 9 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -143,12 +143,12 @@ public class PostgreSQLDialect extends Dialect {
|
|||
registerColumnType( SqlTypes.INET, "inet" );
|
||||
registerColumnType( SqlTypes.INTERVAL_SECOND, "interval second($s)" );
|
||||
|
||||
if ( getVersion().isSince( 8, 2 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 8, 2 ) ) {
|
||||
registerColumnType( SqlTypes.UUID, "uuid" );
|
||||
|
||||
if ( getVersion().isSince( 9, 2 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 9, 2 ) ) {
|
||||
// Prefer jsonb if possible
|
||||
if ( getVersion().isSince( 9, 4 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 9, 4 ) ) {
|
||||
registerColumnType( SqlTypes.JSON, "jsonb" );
|
||||
}
|
||||
else {
|
||||
|
@ -412,7 +412,7 @@ public class PostgreSQLDialect extends Dialect {
|
|||
"(position(?1 in substring(?2 from ?3))+(?3)-1)"
|
||||
).setArgumentListSignature("(pattern, string[, start])");
|
||||
|
||||
if ( getVersion().isSince( 9, 4 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 9, 4 ) ) {
|
||||
CommonFunctionFactory.makeDateTimeTimestamp( queryEngine );
|
||||
}
|
||||
}
|
||||
|
@ -431,32 +431,32 @@ public class PostgreSQLDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsIfExistsBeforeTableName() {
|
||||
return getVersion().isSince( 8, 2 );
|
||||
return getVersion().isSameOrAfter( 8, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsIfExistsBeforeConstraintName() {
|
||||
return getVersion().isSince( 9 );
|
||||
return getVersion().isSameOrAfter( 9 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsIfExistsAfterAlterTable() {
|
||||
return getVersion().isSince( 9, 2 );
|
||||
return getVersion().isSameOrAfter( 9, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsValuesList() {
|
||||
return getVersion().isSince( 8, 2 );
|
||||
return getVersion().isSameOrAfter( 8, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsPartitionBy() {
|
||||
return getVersion().isSince( 9, 1 );
|
||||
return getVersion().isSameOrAfter( 9, 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsNonQueryWithCTE() {
|
||||
return getVersion().isSince( 9, 1 );
|
||||
return getVersion().isSameOrAfter( 9, 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -947,7 +947,7 @@ public class PostgreSQLDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsNoWait() {
|
||||
return getVersion().isSince( 8, 1 );
|
||||
return getVersion().isSameOrAfter( 8, 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -957,7 +957,7 @@ public class PostgreSQLDialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsSkipLocked() {
|
||||
return getVersion().isSince( 9, 5 );
|
||||
return getVersion().isSameOrAfter( 9, 5 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -974,12 +974,12 @@ public class PostgreSQLDialect extends Dialect {
|
|||
public boolean supportsFetchClause(FetchClauseType type) {
|
||||
switch ( type ) {
|
||||
case ROWS_ONLY:
|
||||
return getVersion().isSince( 8, 4 );
|
||||
return getVersion().isSameOrAfter( 8, 4 );
|
||||
case PERCENT_ONLY:
|
||||
case PERCENT_WITH_TIES:
|
||||
return false;
|
||||
case ROWS_WITH_TIES:
|
||||
return getVersion().isSince( 13 );
|
||||
return getVersion().isSameOrAfter( 13 );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -992,13 +992,13 @@ public class PostgreSQLDialect extends Dialect {
|
|||
@Override
|
||||
public void augmentRecognizedTableTypes(List<String> tableTypesList) {
|
||||
super.augmentRecognizedTableTypes( tableTypesList );
|
||||
if ( getVersion().isSince( 9, 3 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 9, 3 ) ) {
|
||||
tableTypesList.add( "MATERIALIZED VIEW" );
|
||||
|
||||
/*
|
||||
PostgreSQL 10 and later adds support for Partition table.
|
||||
*/
|
||||
if ( getVersion().isSince( 10 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 10 ) ) {
|
||||
tableTypesList.add( "PARTITIONED TABLE" );
|
||||
}
|
||||
}
|
||||
|
@ -1025,10 +1025,10 @@ public class PostgreSQLDialect extends Dialect {
|
|||
jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLInetJdbcType.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLIntervalSecondJdbcType.INSTANCE );
|
||||
|
||||
if ( getVersion().isSince( 8, 2 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 8, 2 ) ) {
|
||||
// HHH-9562
|
||||
jdbcTypeRegistry.addDescriptorIfAbsent( UUIDJdbcType.INSTANCE );
|
||||
if ( getVersion().isSince( 9, 2 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 9, 2 ) ) {
|
||||
jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLJsonbJdbcType.INSTANCE );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public class PostgreSQLSqlAstTranslator<T extends JdbcOperation> extends Abstrac
|
|||
|
||||
@Override
|
||||
protected void renderMaterializationHint(CteMaterialization materialization) {
|
||||
if ( getDialect().getVersion().isSince( 12 ) ) {
|
||||
if ( getDialect().getVersion().isSameOrAfter( 12 ) ) {
|
||||
if ( materialization == CteMaterialization.NOT_MATERIALIZED ) {
|
||||
appendSql( "not " );
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class PostgreSQLSqlAstTranslator<T extends JdbcOperation> extends Abstrac
|
|||
|
||||
@Override
|
||||
public boolean supportsFilterClause() {
|
||||
return getDialect().getVersion().isSince( 9, 4 );
|
||||
return getDialect().getVersion().isSameOrAfter( 9, 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -118,7 +118,7 @@ public class PostgreSQLSqlAstTranslator<T extends JdbcOperation> extends Abstrac
|
|||
// We render an empty group instead of literals as some DBs don't support grouping by literals
|
||||
// Note that integer literals, which refer to select item positions, are handled in #visitGroupByClause
|
||||
if ( expression instanceof Literal ) {
|
||||
if ( getDialect().getVersion().isSince( 9, 5 ) ) {
|
||||
if ( getDialect().getVersion().isSameOrAfter( 9, 5 ) ) {
|
||||
appendSql( "()" );
|
||||
}
|
||||
else {
|
||||
|
@ -129,7 +129,7 @@ public class PostgreSQLSqlAstTranslator<T extends JdbcOperation> extends Abstrac
|
|||
}
|
||||
else if ( expression instanceof Summarization ) {
|
||||
Summarization summarization = (Summarization) expression;
|
||||
if ( getDialect().getVersion().isSince( 9, 5 ) ) {
|
||||
if ( getDialect().getVersion().isSameOrAfter( 9, 5 ) ) {
|
||||
appendSql( summarization.getKind().sqlText() );
|
||||
appendSql( OPEN_PARENTHESIS );
|
||||
renderCommaSeparated( summarization.getGroupings() );
|
||||
|
|
|
@ -101,7 +101,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
//but 'float' is double precision by default
|
||||
registerColumnType( Types.DOUBLE, "float" );
|
||||
|
||||
if ( getVersion().isSince( 10 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 10 ) ) {
|
||||
registerColumnType( Types.DATE, "date" );
|
||||
registerColumnType( Types.TIME, "time" );
|
||||
registerColumnType( Types.TIMESTAMP, "datetime2($p)" );
|
||||
|
@ -109,7 +109,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
registerColumnType( SqlTypes.GEOMETRY, "geometry" );
|
||||
}
|
||||
|
||||
if ( getVersion().isSince( 11 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 11 ) ) {
|
||||
exporter = new SqlServerSequenceExporter( this );
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
@Override
|
||||
public TimeZoneSupport getTimeZoneSupport() {
|
||||
return getVersion().isSince( 10 ) ? TimeZoneSupport.NATIVE : TimeZoneSupport.NONE;
|
||||
return getVersion().isSameOrAfter( 10 ) ? TimeZoneSupport.NATIVE : TimeZoneSupport.NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -198,13 +198,13 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
CommonFunctionFactory.everyAny_sumIif( queryEngine );
|
||||
CommonFunctionFactory.bitLength_pattern( queryEngine, "datalength(?1) * 8" );
|
||||
|
||||
if ( getVersion().isSince( 10 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 10 ) ) {
|
||||
CommonFunctionFactory.locate_charindex( queryEngine );
|
||||
CommonFunctionFactory.stddevPopSamp_stdevp( queryEngine );
|
||||
CommonFunctionFactory.varPopSamp_varp( queryEngine );
|
||||
}
|
||||
|
||||
if ( getVersion().isSince( 11 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 11 ) ) {
|
||||
queryEngine.getSqmFunctionRegistry().register( "format", new SQLServerFormatEmulation( this, queryEngine.getTypeConfiguration() ) );
|
||||
|
||||
//actually translate() was added in 2017 but
|
||||
|
@ -308,10 +308,10 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
@Override
|
||||
public LimitHandler getLimitHandler() {
|
||||
if ( getVersion().isSince( 11 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 11 ) ) {
|
||||
return SQLServer2012LimitHandler.INSTANCE;
|
||||
}
|
||||
else if ( getVersion().isSince( 9 ) ) {
|
||||
else if ( getVersion().isSameOrAfter( 9 ) ) {
|
||||
//this is a stateful class, don't cache
|
||||
//it in the Dialect!
|
||||
return new SQLServer2005LimitHandler();
|
||||
|
@ -323,7 +323,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsValuesList() {
|
||||
return getVersion().isSince( 10 );
|
||||
return getVersion().isSameOrAfter( 10 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -338,7 +338,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsIfExistsBeforeTableName() {
|
||||
if ( getVersion().isSince( 16 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 16 ) ) {
|
||||
return true;
|
||||
}
|
||||
return super.supportsIfExistsBeforeTableName();
|
||||
|
@ -346,7 +346,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsIfExistsBeforeConstraintName() {
|
||||
if ( getVersion().isSince( 16 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 16 ) ) {
|
||||
return true;
|
||||
}
|
||||
return super.supportsIfExistsBeforeConstraintName();
|
||||
|
@ -359,7 +359,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
@Override
|
||||
public String appendLockHint(LockOptions lockOptions, String tableName) {
|
||||
if ( getVersion().isSince( 9 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 9 ) ) {
|
||||
LockMode lockMode = lockOptions.getAliasSpecificLockMode( tableName );
|
||||
if (lockMode == null) {
|
||||
lockMode = lockOptions.getLockMode();
|
||||
|
@ -462,17 +462,17 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsNonQueryWithCTE() {
|
||||
return getVersion().isSince( 9 );
|
||||
return getVersion().isSameOrAfter( 9 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSkipLocked() {
|
||||
return getVersion().isSince( 9 );
|
||||
return getVersion().isSameOrAfter( 9 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsNoWait() {
|
||||
return getVersion().isSince( 9 );
|
||||
return getVersion().isSameOrAfter( 9 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -485,7 +485,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
if ( getVersion().isBefore( 11 ) ) {
|
||||
return NoSequenceSupport.INSTANCE;
|
||||
}
|
||||
else if ( getVersion().isSince( 16 ) ) {
|
||||
else if ( getVersion().isSameOrAfter( 16 ) ) {
|
||||
return SQLServer16SequenceSupport.INSTANCE;
|
||||
}
|
||||
else {
|
||||
|
@ -544,7 +544,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsFetchClause(FetchClauseType type) {
|
||||
return getVersion().isSince( 11 );
|
||||
return getVersion().isSameOrAfter( 11 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -826,7 +826,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
@Override
|
||||
public String[] getDropSchemaCommand(String schemaName) {
|
||||
if ( getVersion().isSince( 16 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 16 ) ) {
|
||||
return new String[] { "drop schema if exists " + schemaName };
|
||||
}
|
||||
return super.getDropSchemaCommand( schemaName );
|
||||
|
|
|
@ -80,7 +80,7 @@ public class SQLServerSqlAstTranslator<T extends JdbcOperation> extends Abstract
|
|||
}
|
||||
|
||||
private void renderLockHint(LockMode lockMode) {
|
||||
if ( getDialect().getVersion().isSince( 9 ) ) {
|
||||
if ( getDialect().getVersion().isSameOrAfter( 9 ) ) {
|
||||
final int effectiveLockTimeout = getEffectiveLockTimeout( lockMode );
|
||||
switch ( lockMode ) {
|
||||
//noinspection deprecation
|
||||
|
|
|
@ -76,15 +76,15 @@ public class SybaseASEDialect extends SybaseDialect {
|
|||
registerColumnType( Types.BOOLEAN, "tinyint" );
|
||||
|
||||
|
||||
if ( getVersion().isSince( 12 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 12 ) ) {
|
||||
//date / date were introduced in version 12
|
||||
registerColumnType( Types.DATE, "date" );
|
||||
registerColumnType( Types.TIME, "time" );
|
||||
if ( getVersion().isSince( 15 ) ) {
|
||||
if ( getVersion().isSameOrAfter( 15 ) ) {
|
||||
//bigint was added in version 15
|
||||
registerColumnType( Types.BIGINT, "bigint" );
|
||||
|
||||
if ( getVersion().isSince( 15, 5 ) && !jtdsDriver ) {
|
||||
if ( getVersion().isSameOrAfter( 15, 5 ) && !jtdsDriver ) {
|
||||
//According to Wikipedia bigdatetime and bigtime were added in 15.5
|
||||
//But with jTDS we can't use them as the driver can't handle the types
|
||||
registerColumnType( Types.DATE, "bigdatetime" );
|
||||
|
@ -535,7 +535,7 @@ public class SybaseASEDialect extends SybaseDialect {
|
|||
@Override
|
||||
public boolean supportsExpectedLobUsagePattern() {
|
||||
// Earlier Sybase did not support LOB locators at all
|
||||
return getVersion().isSince( 15, 7 );
|
||||
return getVersion().isSameOrAfter( 15, 7 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -545,7 +545,7 @@ public class SybaseASEDialect extends SybaseDialect {
|
|||
|
||||
@Override
|
||||
public RowLockStrategy getWriteRowLockStrategy() {
|
||||
return getVersion().isSince( 15, 7 ) ? RowLockStrategy.COLUMN : RowLockStrategy.TABLE;
|
||||
return getVersion().isSameOrAfter( 15, 7 ) ? RowLockStrategy.COLUMN : RowLockStrategy.TABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -208,7 +208,7 @@ public class SybaseASESqlAstTranslator<T extends JdbcOperation> extends Abstract
|
|||
protected void renderComparison(Expression lhs, ComparisonOperator operator, Expression rhs) {
|
||||
// I think intersect is only supported in 16.0 SP3
|
||||
if ( getDialect().isAnsiNullOn() ) {
|
||||
if ( getDialect().getVersion().isSince( 16, 3 ) ) {
|
||||
if ( getDialect().getVersion().isSameOrAfter( 16, 3 ) ) {
|
||||
renderComparisonEmulateIntersect( lhs, operator, rhs );
|
||||
}
|
||||
else {
|
||||
|
@ -257,7 +257,7 @@ public class SybaseASESqlAstTranslator<T extends JdbcOperation> extends Abstract
|
|||
}
|
||||
}
|
||||
else {
|
||||
if ( getDialect().getVersion().isSince( 16, 3 ) ) {
|
||||
if ( getDialect().getVersion().isSameOrAfter( 16, 3 ) ) {
|
||||
renderComparisonEmulateIntersect( lhs, operator, rhs );
|
||||
}
|
||||
else {
|
||||
|
@ -362,7 +362,7 @@ public class SybaseASESqlAstTranslator<T extends JdbcOperation> extends Abstract
|
|||
}
|
||||
|
||||
private boolean supportsTopClause() {
|
||||
return getDialect().getVersion().isSince( 12, 5 );
|
||||
return getDialect().getVersion().isSameOrAfter( 12, 5 );
|
||||
}
|
||||
|
||||
private boolean supportsParameterOffsetFetchExpression() {
|
||||
|
|
|
@ -314,7 +314,7 @@ public class SybaseDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
@Override
|
||||
public NameQualifierSupport getNameQualifierSupport() {
|
||||
if ( version.isSince( 15 ) ) {
|
||||
if ( version.isSameOrAfter( 15 ) ) {
|
||||
return NameQualifierSupport.BOTH;
|
||||
}
|
||||
return NameQualifierSupport.CATALOG;
|
||||
|
|
|
@ -114,7 +114,7 @@ public class TiDBSqlAstTranslator<T extends JdbcOperation> extends AbstractSqlAs
|
|||
|
||||
@Override
|
||||
public boolean supportsRowValueConstructorSyntaxInInList() {
|
||||
return getDialect().getVersion().isSince( 5, 7 );
|
||||
return getDialect().getVersion().isSameOrAfter( 5, 7 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -453,7 +453,7 @@ public class AttributeConverterTest extends BaseUnitTestCase {
|
|||
final int expectedJdbcTypeCode;
|
||||
if ( metadata.getDatabase().getDialect() instanceof HANAColumnStoreDialect
|
||||
// Only for SAP HANA Cloud
|
||||
&& metadata.getDatabase().getDialect().getVersion().isSince( 4 ) ) {
|
||||
&& metadata.getDatabase().getDialect().getVersion().isSameOrAfter( 4 ) ) {
|
||||
expectedJdbcTypeCode = Types.NVARCHAR;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -21,8 +21,6 @@ import org.hibernate.dialect.TimeZoneSupport;
|
|||
import org.hibernate.dialect.TiDBDialect;
|
||||
import org.hibernate.query.FetchClauseType;
|
||||
|
||||
import org.hibernate.testing.DialectCheck;
|
||||
|
||||
/**
|
||||
* Container class for different implementation of the {@link DialectFeatureCheck} interface.
|
||||
*
|
||||
|
@ -254,7 +252,7 @@ abstract public class DialectFeatureChecks {
|
|||
public boolean apply(Dialect dialect) {
|
||||
return dialect instanceof DB2Dialect
|
||||
|| dialect instanceof OracleDialect
|
||||
|| dialect instanceof PostgreSQLDialect && dialect.getVersion().isSince( 9, 5 )
|
||||
|| dialect instanceof PostgreSQLDialect && dialect.getVersion().isSameOrAfter( 9, 5 )
|
||||
|| dialect instanceof SQLServerDialect
|
||||
|| dialect instanceof DerbyDialect
|
||||
|| dialect instanceof MySQLDialect && !(dialect instanceof TiDBDialect)
|
||||
|
@ -266,7 +264,7 @@ abstract public class DialectFeatureChecks {
|
|||
public boolean apply(Dialect dialect) {
|
||||
return dialect instanceof DB2Dialect
|
||||
|| dialect instanceof OracleDialect
|
||||
|| dialect instanceof PostgreSQLDialect && dialect.getVersion().isSince( 9, 5 )
|
||||
|| dialect instanceof PostgreSQLDialect && dialect.getVersion().isSameOrAfter( 9, 5 )
|
||||
|| dialect instanceof SQLServerDialect;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ public class DialectFilterExtension implements ExecutionCondition {
|
|||
}
|
||||
|
||||
if ( matchNewerVersions ) {
|
||||
return dialect.getVersion().isSince( matchingMajorVersion, matchingMinorVersion, matchingMicroVersion );
|
||||
return dialect.getVersion().isSameOrAfter( matchingMajorVersion, matchingMinorVersion, matchingMicroVersion );
|
||||
}
|
||||
else {
|
||||
return dialect.getVersion().isSame( matchingMajorVersion );
|
||||
|
|
Loading…
Reference in New Issue