Set strategySelector before reflectionOptimizer is resolved

This commit is contained in:
Chris Cranford 2021-03-09 14:00:54 -05:00 committed by Christian Beikov
parent 06d2a0c23e
commit 87a40f6c2f
1 changed files with 3 additions and 2 deletions

View File

@ -137,6 +137,9 @@ public class StandardPojoEntityRepresentationStrategy implements EntityRepresent
}
this.proxyFactory = proxyFactory;
// resolveReflectionOptimizer may lead to a makePropertyAccess call which requires strategySelector
this.strategySelector = sessionFactory.getServiceRegistry().getService( StrategySelector.class );
this.reflectionOptimizer = resolveReflectionOptimizer( bootDescriptor, bytecodeProvider, sessionFactory );
if ( reflectionOptimizer != null ) {
@ -151,8 +154,6 @@ public class StandardPojoEntityRepresentationStrategy implements EntityRepresent
else {
this.instantiator = new PojoInstantiatorImpl<>( mappedJtd );
}
this.strategySelector = sessionFactory.getServiceRegistry().getService( StrategySelector.class );
}
private PropertyAccess resolveIdentifierPropertyAccess(PersistentClass bootDescriptor) {