From c10493435ef924d867d679a96607ce2bb3864767 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Wed, 9 Jun 2021 15:05:19 +0100 Subject: [PATCH] HHH-14667 Skip loading all keywords from the DB when keyword auto-quoting is disabled --- .../engine/jdbc/env/spi/IdentifierHelperBuilder.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/IdentifierHelperBuilder.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/IdentifierHelperBuilder.java index 0f74afd8f3..74de34f772 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/IdentifierHelperBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/IdentifierHelperBuilder.java @@ -61,6 +61,10 @@ public class IdentifierHelperBuilder { return; } + //Important optimisation: skip loading all keywords from the DB when autoQuoteKeywords is disabled + if ( autoQuoteKeywords == false ) { + return; + } this.reservedWords.addAll( parseKeywords( metaData.getSQLKeywords() ) ); } @@ -176,6 +180,10 @@ public class IdentifierHelperBuilder { } public void applyReservedWords(Set words) { + //No use when autoQuoteKeywords is disabled + if ( autoQuoteKeywords == false ) { + return; + } this.reservedWords.addAll( words ); }