Removed Dialect#areStringComparisonsCaseInsensitive() method

This commit is contained in:
Andrea Boriero 2021-09-24 11:36:31 +02:00
parent ca83c6ca7e
commit 573d146046
9 changed files with 3 additions and 64 deletions

View File

@ -397,11 +397,6 @@ public class CacheDialect extends Dialect {
return false; return false;
} }
@Override
public boolean areStringComparisonsCaseInsensitive() {
return true;
}
@Override @Override
public boolean supportsOrderByInSubquery() { public boolean supportsOrderByInSubquery() {
// This is just a guess // This is just a guess

View File

@ -341,11 +341,6 @@ public class TeradataDialect extends Dialect {
return false; return false;
} }
@Override
public boolean areStringComparisonsCaseInsensitive() {
return getVersion() < 14;
}
@Override @Override
public boolean supportsEmptyInList() { public boolean supportsEmptyInList() {
return false; return false;

View File

@ -2930,18 +2930,6 @@ public abstract class Dialect implements ConversionContext {
return true; return true;
} }
/**
* Are string comparisons implicitly case insensitive.
* <p/>
* In other words, does [where 'XYZ' = 'xyz'] resolve to true?
*
* @return True if comparisons are case insensitive.
* @since 3.2
*/
public boolean areStringComparisonsCaseInsensitive() {
return false;
}
/** /**
* Is this dialect known to support what ANSI-SQL terms "row value * Is this dialect known to support what ANSI-SQL terms "row value
* constructor" syntax; sometimes called tuple syntax. * constructor" syntax; sometimes called tuple syntax.

View File

@ -787,11 +787,6 @@ public class MySQLDialect extends Dialect {
return false; return false;
} }
@Override
public boolean areStringComparisonsCaseInsensitive() {
return true;
}
@Override @Override
public boolean supportsLobValueChangePropagation() { public boolean supportsLobValueChangePropagation() {
// note: at least my local MySQL 5.1 install shows this not working... // note: at least my local MySQL 5.1 install shows this not working...

View File

@ -387,11 +387,6 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
public boolean areStringComparisonsCaseInsensitive() {
return true;
}
@Override @Override
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() { public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
return false; return false;

View File

@ -482,19 +482,6 @@ public class SybaseASEDialect extends SybaseDialect {
return 30; return 30;
} }
/**
* By default, Sybase string comparisons are case-insensitive.
* <p/>
* If the DB is configured to be case-sensitive, then this return
* value will be incorrect.
* <p/>
* {@inheritDoc}
*/
@Override
public boolean areStringComparisonsCaseInsensitive() {
return true;
}
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public String getCurrentTimestampSQLFunctionName() { public String getCurrentTimestampSQLFunctionName() {

View File

@ -371,15 +371,11 @@ public class QueryCacheTest {
} }
@Test @Test
@RequiresDialectFeature( public void testComparison(SessionFactoryScope scope) {
feature = DialectFeatureChecks.CaseSensitiveCheck.class,
comment = "i.name='widget' should not match on case sensitive database."
)
public void testCaseInsensitiveComparison(SessionFactoryScope scope) {
Item item = new Item(); Item item = new Item();
scope.inTransaction( scope.inTransaction(
session -> { session -> {
item.setName( "Widget" ); item.setName( "widget" );
item.setDescription( "A really top-quality, full-featured widget." ); item.setDescription( "A really top-quality, full-featured widget." );
session.save( item ); session.save( item );
} }
@ -390,7 +386,7 @@ public class QueryCacheTest {
List result = session.createQuery( queryString ).list(); List result = session.createQuery( queryString ).list();
assertEquals( 1, result.size() ); assertEquals( 1, result.size() );
Item i = session.get( Item.class, item.getId() ); Item i = session.get( Item.class, item.getId() );
assertEquals( "Widget", i.getName() ); assertEquals( "widget", i.getName() );
session.delete( i ); session.delete( i );
} }
); );

View File

@ -63,12 +63,6 @@ abstract public class DialectChecks {
} }
} }
public static class CaseSensitiveCheck implements DialectCheck {
public boolean isMatch(Dialect dialect) {
return dialect.areStringComparisonsCaseInsensitive();
}
}
public static class SupportsResultSetPositioningOnForwardOnlyCursorCheck implements DialectCheck { public static class SupportsResultSetPositioningOnForwardOnlyCursorCheck implements DialectCheck {
public boolean isMatch(Dialect dialect) { public boolean isMatch(Dialect dialect) {
return dialect.supportsResultSetPositionQueryMethodsOnForwardOnlyCursor(); return dialect.supportsResultSetPositionQueryMethodsOnForwardOnlyCursor();

View File

@ -80,12 +80,6 @@ abstract public class DialectFeatureChecks {
} }
} }
public static class CaseSensitiveCheck implements DialectFeatureCheck {
public boolean apply(Dialect dialect) {
return dialect.areStringComparisonsCaseInsensitive();
}
}
public static class SupportsNoColumnInsert implements DialectFeatureCheck { public static class SupportsNoColumnInsert implements DialectFeatureCheck {
public boolean apply(Dialect dialect) { public boolean apply(Dialect dialect) {
return dialect.supportsNoColumnsInsert(); return dialect.supportsNoColumnsInsert();