mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-24 04:05:39 +00:00
HHH-14305 Memory optimisation for AbstractEntityPersister#affectingFetchProfileNames
This commit is contained in:
parent
169a01857c
commit
2dde4c1710
@ -248,7 +248,7 @@ public abstract class AbstractEntityPersister
|
||||
// dynamic filters attached to the class-level
|
||||
private final FilterHelper filterHelper;
|
||||
|
||||
private final Set<String> affectingFetchProfileNames = new HashSet<>();
|
||||
private volatile Set<String> affectingFetchProfileNames;
|
||||
|
||||
private final Map uniqueKeyLoaders = new HashMap();
|
||||
|
||||
@ -4466,6 +4466,9 @@ public List multiLoad(Serializable[] ids, SharedSessionContractImplementor sessi
|
||||
}
|
||||
|
||||
public void registerAffectingFetchProfile(String fetchProfileName) {
|
||||
if ( affectingFetchProfileNames == null ) {
|
||||
this.affectingFetchProfileNames = new HashSet<>();
|
||||
}
|
||||
affectingFetchProfileNames.add( fetchProfileName );
|
||||
}
|
||||
|
||||
@ -4474,11 +4477,14 @@ private boolean isAffectedByEntityGraph(SharedSessionContractImplementor session
|
||||
}
|
||||
|
||||
private boolean isAffectedByEnabledFetchProfiles(SharedSessionContractImplementor session) {
|
||||
final Set<String> fetchProfileNames = this.affectingFetchProfileNames;
|
||||
if ( fetchProfileNames != null ) {
|
||||
for ( String s : session.getLoadQueryInfluencers().getEnabledFetchProfileNames() ) {
|
||||
if ( affectingFetchProfileNames.contains( s ) ) {
|
||||
if ( fetchProfileNames.contains( s ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user