From ab8c81482c7d7d0f65a8f7e9a584dacef965bbf5 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Wed, 9 Jun 2021 22:56:29 +0100 Subject: [PATCH] HHH-14667 Remove also ExtractedDatabaseMetaData#getExtraKeywords() as it's unused as well --- .../ExtractedDatabaseMetaDataImpl.java | 36 ------------------- .../env/spi/ExtractedDatabaseMetaData.java | 9 ----- .../test/jdbc/env/NoDatabaseMetaDataTest.java | 2 -- 3 files changed, 47 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/ExtractedDatabaseMetaDataImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/ExtractedDatabaseMetaDataImpl.java index d16643cebf..18a40d684c 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/ExtractedDatabaseMetaDataImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/ExtractedDatabaseMetaDataImpl.java @@ -10,7 +10,6 @@ import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Collections; -import java.util.HashSet; import java.util.List; import java.util.Set; @@ -41,14 +40,12 @@ public class ExtractedDatabaseMetaDataImpl implements ExtractedDatabaseMetaData private final boolean doesDataDefinitionCauseTransactionCommit; private final SQLStateType sqlStateType; - private final Set extraKeywords; private final List sequenceInformationList; private ExtractedDatabaseMetaDataImpl( JdbcEnvironment jdbcEnvironment, String connectionCatalogName, String connectionSchemaName, - Set extraKeywords, boolean supportsRefCursors, boolean supportsNamedParameters, boolean supportsScrollableResults, @@ -59,14 +56,8 @@ public class ExtractedDatabaseMetaDataImpl implements ExtractedDatabaseMetaData SQLStateType sqlStateType, List sequenceInformationList) { this.jdbcEnvironment = jdbcEnvironment; - this.connectionCatalogName = connectionCatalogName; this.connectionSchemaName = connectionSchemaName; - - this.extraKeywords = extraKeywords != null - ? extraKeywords - : Collections.emptySet(); - this.supportsRefCursors = supportsRefCursors; this.supportsNamedParameters = supportsNamedParameters; this.supportsScrollableResults = supportsScrollableResults; @@ -118,11 +109,6 @@ public class ExtractedDatabaseMetaDataImpl implements ExtractedDatabaseMetaData return doesDataDefinitionCauseTransactionCommit; } - @Override - public Set getExtraKeywords() { - return extraKeywords; - } - @Override public SQLStateType getSqlStateType() { return sqlStateType; @@ -149,8 +135,6 @@ public class ExtractedDatabaseMetaDataImpl implements ExtractedDatabaseMetaData private String connectionSchemaName; private String connectionCatalogName; - private Set extraKeywords; - private boolean supportsRefCursors; private boolean supportsNamedParameters; private boolean supportsScrollableResults; @@ -175,7 +159,6 @@ public class ExtractedDatabaseMetaDataImpl implements ExtractedDatabaseMetaData supportsBatchUpdates = databaseMetaData.supportsBatchUpdates(); supportsDataDefinitionInTransaction = !databaseMetaData.dataDefinitionIgnoredInTransactions(); doesDataDefinitionCauseTransactionCommit = databaseMetaData.dataDefinitionCausesTransactionCommit(); - extraKeywords = parseKeywords( databaseMetaData.getSQLKeywords() ); sqlStateType = SQLStateType.interpretReportedSQLStateType( databaseMetaData.getSQLStateType() ); return this; } @@ -194,24 +177,6 @@ public class ExtractedDatabaseMetaDataImpl implements ExtractedDatabaseMetaData return this; } - public Builder setExtraKeywords(Set extraKeywords) { - if ( this.extraKeywords == null ) { - this.extraKeywords = extraKeywords; - } - else { - this.extraKeywords.addAll( extraKeywords ); - } - return this; - } - - public Builder addExtraKeyword(String keyword) { - if ( this.extraKeywords == null ) { - this.extraKeywords = new HashSet(); - } - this.extraKeywords.add( keyword ); - return this; - } - public Builder setSupportsRefCursors(boolean supportsRefCursors) { this.supportsRefCursors = supportsRefCursors; return this; @@ -262,7 +227,6 @@ public class ExtractedDatabaseMetaDataImpl implements ExtractedDatabaseMetaData jdbcEnvironment, connectionCatalogName, connectionSchemaName, - extraKeywords, supportsRefCursors, supportsNamedParameters, supportsScrollableResults, diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/ExtractedDatabaseMetaData.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/ExtractedDatabaseMetaData.java index a87ac93420..33f5a4c57d 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/ExtractedDatabaseMetaData.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/ExtractedDatabaseMetaData.java @@ -45,15 +45,6 @@ public interface ExtractedDatabaseMetaData { */ String getConnectionSchemaName(); - /** - * Get the list of extra keywords (beyond standard SQL92 keywords) reported by the driver. - * - * @return The extra keywords used by this database. - * - * @see java.sql.DatabaseMetaData#getSQLKeywords() - */ - Set getExtraKeywords(); - /** * Does the driver report supporting named parameters? * diff --git a/hibernate-core/src/test/java/org/hibernate/test/jdbc/env/NoDatabaseMetaDataTest.java b/hibernate-core/src/test/java/org/hibernate/test/jdbc/env/NoDatabaseMetaDataTest.java index ef92e999a4..dbe88a7c4e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jdbc/env/NoDatabaseMetaDataTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jdbc/env/NoDatabaseMetaDataTest.java @@ -38,7 +38,6 @@ public class NoDatabaseMetaDataTest extends BaseUnitTestCase { assertNull( extractedDatabaseMetaData.getConnectionCatalogName() ); assertNull( extractedDatabaseMetaData.getConnectionSchemaName() ); - assertTrue( extractedDatabaseMetaData.getExtraKeywords().isEmpty() ); assertFalse( extractedDatabaseMetaData.supportsNamedParameters() ); assertFalse( extractedDatabaseMetaData.supportsRefCursors() ); assertFalse( extractedDatabaseMetaData.supportsScrollableResults() ); @@ -63,7 +62,6 @@ public class NoDatabaseMetaDataTest extends BaseUnitTestCase { assertNull( extractedDatabaseMetaData.getConnectionCatalogName() ); assertNull( extractedDatabaseMetaData.getConnectionSchemaName() ); - assertTrue( extractedDatabaseMetaData.getExtraKeywords().isEmpty() ); assertTrue( extractedDatabaseMetaData.supportsNamedParameters() ); assertFalse( extractedDatabaseMetaData.supportsRefCursors() ); assertFalse( extractedDatabaseMetaData.supportsScrollableResults() );