1515import org .hibernate .engine .jdbc .env .spi .JdbcEnvironment ;
1616import org .hibernate .engine .jdbc .env .spi .NameQualifierSupport ;
1717
18- import org .jboss .logging .Logger ;
19-
2018/**
2119* @author Steve Ebersole
2220*/
2321public class NormalizingIdentifierHelperImpl implements IdentifierHelper {
24- private static final Logger log = Logger .getLogger ( NormalizingIdentifierHelperImpl .class );
2522
2623 private final JdbcEnvironment jdbcEnvironment ;
2724
@@ -57,8 +54,6 @@ public NormalizingIdentifierHelperImpl(
5754
5855 @ Override
5956 public Identifier normalizeQuoting (Identifier identifier ) {
60- log .tracef ( "Normalizing identifier quoting [%s]" , identifier );
61-
6257 if ( identifier == null ) {
6358 return null ;
6459 }
@@ -68,17 +63,14 @@ public Identifier normalizeQuoting(Identifier identifier) {
6863 }
6964
7065 if ( globallyQuoteIdentifiers ) {
71- log .tracef ( "Forcing identifier [%s] to quoted for global quoting" , identifier );
7266 return Identifier .toIdentifier ( identifier .getText (), true );
7367 }
7468
7569 if ( autoQuoteKeywords && isReservedWord ( identifier .getText () ) ) {
76- log .tracef ( "Forcing identifier [%s] to quoted as recognized reserved word" , identifier );
7770 return Identifier .toIdentifier ( identifier .getText (), true );
7871 }
7972
8073 if ( autoQuoteInitialUnderscore && identifier .getText ().startsWith ("_" ) ) {
81- log .tracef ( "Forcing identifier [%s] to quoted due to initial underscore" , identifier );
8274 return Identifier .toIdentifier ( identifier .getText (), true );
8375 }
8476
@@ -110,10 +102,7 @@ public boolean isReservedWord(String word) {
110102
111103 @ Override
112104 public String toMetaDataCatalogName (Identifier identifier ) {
113- log .tracef ( "Normalizing identifier quoting for catalog name [%s]" , identifier );
114-
115105 if ( !nameQualifierSupport .supportsCatalogs () ) {
116- log .trace ( "Environment does not support catalogs; returning null" );
117106 // null is used to tell DatabaseMetaData to not limit results based on catalog.
118107 return null ;
119108 }
@@ -139,50 +128,24 @@ private String toMetaDataText(Identifier identifier) {
139128 }
140129 else if ( identifier .isQuoted () ) {
141130 return switch ( quotedCaseStrategy ) {
142- case UPPER -> {
143- log .tracef ( "Rendering quoted identifier [%s] in upper case for use in DatabaseMetaData" ,
144- identifier );
145- yield text .toUpperCase ( Locale .ROOT );
146- }
147- case LOWER -> {
148- log .tracef ( "Rendering quoted identifier [%s] in lower case for use in DatabaseMetaData" ,
149- identifier );
150- yield text .toLowerCase ( Locale .ROOT );
151- }
152- default -> {
153- // default is mixed case
154- log .tracef ( "Rendering quoted identifier [%s] in mixed case for use in DatabaseMetaData" ,
155- identifier );
156- yield text ;
157- }
131+ case UPPER -> text .toUpperCase ( Locale .ROOT );
132+ case LOWER -> text .toLowerCase ( Locale .ROOT );
133+ case MIXED -> text ; // default
158134 };
159135 }
160136 else {
161137 return switch ( unquotedCaseStrategy ) {
162- case MIXED -> {
163- log .tracef ( "Rendering unquoted identifier [%s] in mixed case for use in DatabaseMetaData" , identifier );
164- yield text ;
165- }
166- case LOWER -> {
167- log .tracef ( "Rendering unquoted identifier [%s] in lower case for use in DatabaseMetaData" , identifier );
168- yield text .toLowerCase ( Locale .ROOT );
169- }
170- default -> {
171- // default is upper case
172- log .tracef ( "Rendering unquoted identifier [%s] in upper case for use in DatabaseMetaData" , identifier );
173- yield text .toUpperCase ( Locale .ROOT );
174- }
138+ case MIXED -> text ;
139+ case LOWER -> text .toLowerCase ( Locale .ROOT );
140+ case UPPER -> text .toUpperCase ( Locale .ROOT ); // default
175141 };
176142 }
177143 }
178144
179145 @ Override
180146 public String toMetaDataSchemaName (Identifier identifier ) {
181- log .tracef ( "Normalizing identifier quoting for schema name [%s]" , identifier );
182-
183147 if ( !nameQualifierSupport .supportsSchemas () ) {
184148 // null is used to tell DatabaseMetaData to not limit results based on schema.
185- log .trace ( "Environment does not support catalogs; returning null" );
186149 return null ;
187150 }
188151
@@ -198,8 +161,6 @@ public String toMetaDataSchemaName(Identifier identifier) {
198161
199162 @ Override
200163 public String toMetaDataObjectName (Identifier identifier ) {
201- log .tracef ( "Normalizing identifier quoting for object name [%s]" , identifier );
202-
203164 if ( identifier == null ) {
204165 // if this method was called, the value is needed
205166 throw new IllegalArgumentException ( "null was passed as an object name" );
0 commit comments