HHH-15274 Optimise LazyAttributeLoadingInterceptor's routines to identify lazy fields
This commit is contained in:
parent
3630fbad9b
commit
8e78a61bcc
|
@ -29,6 +29,8 @@ import org.hibernate.persister.entity.EntityPersister;
|
|||
*/
|
||||
public class LazyAttributeLoadingInterceptor extends AbstractLazyLoadInterceptor {
|
||||
private final Object identifier;
|
||||
|
||||
//N.B. this Set needs to be treated as immutable
|
||||
private final Set<String> lazyFields;
|
||||
private Set<String> initializedLazyFields;
|
||||
|
||||
|
@ -39,7 +41,8 @@ public class LazyAttributeLoadingInterceptor extends AbstractLazyLoadInterceptor
|
|||
SharedSessionContractImplementor session) {
|
||||
super( entityName, session );
|
||||
this.identifier = identifier;
|
||||
this.lazyFields = lazyFields;
|
||||
//Important optimisation to not actually do a Map lookup for entities which don't have any lazy fields at all:
|
||||
this.lazyFields = org.hibernate.internal.util.collections.CollectionHelper.toSmallSet( lazyFields );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue