Skip to content

Commit

Permalink
Removed Dialect#areStringComparisonsCaseInsensitive() method
Browse files Browse the repository at this point in the history
  • Loading branch information
dreab8 committed Sep 25, 2021
1 parent ca83c6c commit 573d146
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 64 deletions.
Expand Up @@ -397,11 +397,6 @@ public boolean supportsEmptyInList() {
return false;
}

@Override
public boolean areStringComparisonsCaseInsensitive() {
return true;
}

@Override
public boolean supportsOrderByInSubquery() {
// This is just a guess
Expand Down
Expand Up @@ -341,11 +341,6 @@ public boolean supportsExistsInSelect() {
return false;
}

@Override
public boolean areStringComparisonsCaseInsensitive() {
return getVersion() < 14;
}

@Override
public boolean supportsEmptyInList() {
return false;
Expand Down
12 changes: 0 additions & 12 deletions hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java
Expand Up @@ -2930,18 +2930,6 @@ public boolean supportsEmptyInList() {
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
* constructor" syntax; sometimes called tuple syntax.
Expand Down
Expand Up @@ -787,11 +787,6 @@ public boolean supportsEmptyInList() {
return false;
}

@Override
public boolean areStringComparisonsCaseInsensitive() {
return true;
}

@Override
public boolean supportsLobValueChangePropagation() {
// note: at least my local MySQL 5.1 install shows this not working...
Expand Down
Expand Up @@ -387,11 +387,6 @@ public String getCurrentTimestampSelectString() {

// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@Override
public boolean areStringComparisonsCaseInsensitive() {
return true;
}

@Override
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
return false;
Expand Down
Expand Up @@ -482,19 +482,6 @@ public int getMaxAliasLength() {
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
@SuppressWarnings("deprecation")
public String getCurrentTimestampSQLFunctionName() {
Expand Down
Expand Up @@ -371,15 +371,11 @@ public void testQueryCacheInvalidation(SessionFactoryScope scope) throws Excepti
}

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

public static class CaseSensitiveCheck implements DialectCheck {
public boolean isMatch(Dialect dialect) {
return dialect.areStringComparisonsCaseInsensitive();
}
}

public static class SupportsResultSetPositioningOnForwardOnlyCursorCheck implements DialectCheck {
public boolean isMatch(Dialect dialect) {
return dialect.supportsResultSetPositionQueryMethodsOnForwardOnlyCursor();
Expand Down
Expand Up @@ -80,12 +80,6 @@ public boolean apply(Dialect dialect) {
}
}

public static class CaseSensitiveCheck implements DialectFeatureCheck {
public boolean apply(Dialect dialect) {
return dialect.areStringComparisonsCaseInsensitive();
}
}

public static class SupportsNoColumnInsert implements DialectFeatureCheck {
public boolean apply(Dialect dialect) {
return dialect.supportsNoColumnsInsert();
Expand Down

0 comments on commit 573d146

Please sign in to comment.