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 {
|
public class LazyAttributeLoadingInterceptor extends AbstractLazyLoadInterceptor {
|
||||||
private final Object identifier;
|
private final Object identifier;
|
||||||
|
|
||||||
|
//N.B. this Set needs to be treated as immutable
|
||||||
private final Set<String> lazyFields;
|
private final Set<String> lazyFields;
|
||||||
private Set<String> initializedLazyFields;
|
private Set<String> initializedLazyFields;
|
||||||
|
|
||||||
|
@ -39,7 +41,8 @@ public class LazyAttributeLoadingInterceptor extends AbstractLazyLoadInterceptor
|
||||||
SharedSessionContractImplementor session) {
|
SharedSessionContractImplementor session) {
|
||||||
super( entityName, session );
|
super( entityName, session );
|
||||||
this.identifier = identifier;
|
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
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue