3838import org .springframework .context .ApplicationEventPublisher ;
3939import org .springframework .context .ApplicationEventPublisherAware ;
4040import org .springframework .core .KotlinDetector ;
41+ import org .springframework .core .NativeDetector ;
4142import org .springframework .data .mapping .MappingException ;
4243import org .springframework .data .mapping .PersistentEntity ;
4344import org .springframework .data .mapping .PersistentProperty ;
8687public abstract class AbstractMappingContext <E extends MutablePersistentEntity <?, P >, P extends PersistentProperty <P >>
8788 implements MappingContext <E , P >, ApplicationEventPublisherAware , ApplicationContextAware , InitializingBean {
8889
89- private static final boolean IN_NATIVE_IMAGE = System .getProperty ("org.graalvm.nativeimage.imagecode" ) != null ;
90-
9190 private final Optional <E > NONE = Optional .empty ();
9291 private final Map <TypeInformation <?>, Optional <E >> persistentEntities = new HashMap <>();
9392 private final PersistentPropertyAccessorFactory persistentPropertyAccessorFactory ;
@@ -109,7 +108,7 @@ protected AbstractMappingContext() {
109108 this .persistentPropertyPathFactory = new PersistentPropertyPathFactory <>(this );
110109
111110 EntityInstantiators instantiators = new EntityInstantiators ();
112- PersistentPropertyAccessorFactory accessorFactory = IN_NATIVE_IMAGE ? BeanWrapperPropertyAccessorFactory .INSTANCE
111+ PersistentPropertyAccessorFactory accessorFactory = NativeDetector . inNativeImage () ? BeanWrapperPropertyAccessorFactory .INSTANCE
113112 : new ClassGeneratingPropertyAccessorFactory ();
114113
115114 this .persistentPropertyAccessorFactory = new InstantiationAwarePropertyAccessorFactory (accessorFactory ,
0 commit comments