HHH-9057 Correct ObjectNameNormalizer for mssql-style quoting

This commit is contained in:
Brett Meyer 2014-03-17 15:11:54 -04:00
parent 548aa7c0de
commit 773f6ddfde
1 changed files with 6 additions and 0 deletions

View File

@ -108,6 +108,12 @@ public abstract class ObjectNameNormalizer {
return '`' + identifier.substring( 1, identifier.length() - 1 ) + '`';
}
// Convert SQLServer style quoting
// TODO: This really should be tied to Dialect#openQuote/closeQuote
if ( identifier.startsWith( "[" ) && identifier.endsWith( "]" ) ) {
return '`' + identifier.substring( 1, identifier.length() - 1 ) + '`';
}
// If the user has requested "global" use of quoted identifiers, quote this identifier (using back ticks)
// if not already
if ( isUseQuotedIdentifiersGlobally() && ! ( identifier.startsWith( "`" ) && identifier.endsWith( "`" ) ) ) {