HHH-13529 Specifically optimise Dialect retrieval from DefaultEntityAliases

This commit is contained in:
Sanne Grinovero 2019-07-31 17:41:05 +01:00 committed by Sanne Grinovero
parent 6e373f2e17
commit edb8093319
1 changed files with 7 additions and 4 deletions

View File

@ -9,6 +9,7 @@ package org.hibernate.loader;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
import org.hibernate.dialect.Dialect;
import org.hibernate.internal.util.StringHelper; import org.hibernate.internal.util.StringHelper;
import org.hibernate.persister.entity.Loadable; import org.hibernate.persister.entity.Loadable;
@ -133,16 +134,18 @@ public class DefaultEntityAliases implements EntityAliases {
@Override @Override
public String[][] getSuffixedPropertyAliases(Loadable persister) { public String[][] getSuffixedPropertyAliases(Loadable persister) {
final int size = persister.getPropertyNames().length; final String[] propertyNames = persister.getPropertyNames();
final int size = propertyNames.length;
final String[][] suffixedPropertyAliases; final String[][] suffixedPropertyAliases;
if (size > 0) { if ( size > 0 ) {
suffixedPropertyAliases = new String[size][]; suffixedPropertyAliases = new String[size][];
final Dialect dialect = persister.getFactory().getDialect();
for ( int j = 0; j < size; j++ ) { for ( int j = 0; j < size; j++ ) {
suffixedPropertyAliases[j] = getUserProvidedAliases( suffixedPropertyAliases[j] = getUserProvidedAliases(
persister.getPropertyNames()[j], propertyNames[j],
getPropertyAliases( persister, j ) getPropertyAliases( persister, j )
); );
suffixedPropertyAliases[j] = StringHelper.unquote( suffixedPropertyAliases[j], persister.getFactory().getDialect() ); suffixedPropertyAliases[j] = StringHelper.unquote( suffixedPropertyAliases[j], dialect );
} }
} }
else { else {