HHH-13513 Only intern fields of DefaultEntityAliases when the object is not short lived
This commit is contained in:
parent
bfe5f235c1
commit
ed8c72871b
|
@ -42,18 +42,31 @@ public class DefaultEntityAliases implements EntityAliases {
|
||||||
Map userProvidedAliases,
|
Map userProvidedAliases,
|
||||||
Loadable persister,
|
Loadable persister,
|
||||||
String suffix) {
|
String suffix) {
|
||||||
this.suffix = suffix.intern();
|
this( userProvidedAliases, persister, suffix, false );
|
||||||
this.userProvidedAliases = userProvidedAliases;
|
}
|
||||||
|
|
||||||
|
public DefaultEntityAliases(Loadable persister, String suffix) {
|
||||||
|
this( Collections.EMPTY_MAP, persister, suffix, true );
|
||||||
|
}
|
||||||
|
|
||||||
|
private DefaultEntityAliases(
|
||||||
|
Map userProvidedAliases,
|
||||||
|
Loadable persister,
|
||||||
|
String suffix,
|
||||||
|
boolean interns) {
|
||||||
|
if ( interns ) {
|
||||||
|
this.suffix = suffix.intern();
|
||||||
|
this.rowIdAlias = (Loadable.ROWID_ALIAS + suffix).intern(); // TODO: not visible to the user!
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.suffix = suffix;
|
||||||
|
this.rowIdAlias = (Loadable.ROWID_ALIAS + suffix);
|
||||||
|
}
|
||||||
|
this.userProvidedAliases = userProvidedAliases;
|
||||||
suffixedKeyColumns = determineKeyAlias( persister, suffix );
|
suffixedKeyColumns = determineKeyAlias( persister, suffix );
|
||||||
suffixedPropertyColumns = determinePropertyAliases( persister );
|
suffixedPropertyColumns = determinePropertyAliases( persister );
|
||||||
suffixedDiscriminatorColumn = determineDiscriminatorAlias( persister, suffix );
|
suffixedDiscriminatorColumn = determineDiscriminatorAlias( persister, suffix );
|
||||||
suffixedVersionColumn = determineVersionAlias( persister );
|
suffixedVersionColumn = determineVersionAlias( persister );
|
||||||
rowIdAlias = (Loadable.ROWID_ALIAS + suffix).intern(); // TODO: not visible to the user!
|
|
||||||
}
|
|
||||||
|
|
||||||
public DefaultEntityAliases(Loadable persister, String suffix) {
|
|
||||||
this( Collections.EMPTY_MAP, persister, suffix );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] determineKeyAlias(Loadable persister, String suffix) {
|
private String[] determineKeyAlias(Loadable persister, String suffix) {
|
||||||
|
|
Loading…
Reference in New Issue