@@ -277,28 +277,26 @@ private <T> T updateIndexedObject(T entity, IndexedObjectInformation indexedObje
277
277
routingResolver );
278
278
adaptibleEntity .populateIdIfNecessary (indexedObjectInformation .getId ());
279
279
280
- ElasticsearchPersistentEntity <?> persistentEntity = getRequiredPersistentEntity (entity .getClass ());
281
- PersistentPropertyAccessor <Object > propertyAccessor = persistentEntity .getPropertyAccessor (entity );
282
-
283
- if (indexedObjectInformation .getSeqNo () != null && indexedObjectInformation .getPrimaryTerm () != null
284
- && persistentEntity .hasSeqNoPrimaryTermProperty ()) {
285
- ElasticsearchPersistentProperty seqNoPrimaryTermProperty = persistentEntity .getSeqNoPrimaryTermProperty ();
286
- propertyAccessor .setProperty (seqNoPrimaryTermProperty ,
287
- new SeqNoPrimaryTerm (indexedObjectInformation .getSeqNo (), indexedObjectInformation .getPrimaryTerm ()));
288
- }
280
+ ElasticsearchPersistentEntity <?> persistentEntity = getPersistentEntityFor (entity .getClass ());
281
+ if (persistentEntity != null ) {
282
+ PersistentPropertyAccessor <Object > propertyAccessor = persistentEntity .getPropertyAccessor (entity );
283
+
284
+ if (indexedObjectInformation .getSeqNo () != null && indexedObjectInformation .getPrimaryTerm () != null
285
+ && persistentEntity .hasSeqNoPrimaryTermProperty ()) {
286
+ ElasticsearchPersistentProperty seqNoPrimaryTermProperty = persistentEntity .getSeqNoPrimaryTermProperty ();
287
+ propertyAccessor .setProperty (seqNoPrimaryTermProperty ,
288
+ new SeqNoPrimaryTerm (indexedObjectInformation .getSeqNo (), indexedObjectInformation .getPrimaryTerm ()));
289
+ }
289
290
290
- if (indexedObjectInformation .getVersion () != null && persistentEntity .hasVersionProperty ()) {
291
- ElasticsearchPersistentProperty versionProperty = persistentEntity .getVersionProperty ();
292
- propertyAccessor .setProperty (versionProperty , indexedObjectInformation .getVersion ());
291
+ if (indexedObjectInformation .getVersion () != null && persistentEntity .hasVersionProperty ()) {
292
+ ElasticsearchPersistentProperty versionProperty = persistentEntity .getVersionProperty ();
293
+ propertyAccessor .setProperty (versionProperty , indexedObjectInformation .getVersion ());
294
+ }
293
295
}
294
296
295
297
return entity ;
296
298
}
297
299
298
- private ElasticsearchPersistentEntity <?> getRequiredPersistentEntity (Class <?> clazz ) {
299
- return converter .getMappingContext ().getRequiredPersistentEntity (clazz );
300
- }
301
-
302
300
@ Override
303
301
public <T > Flux <T > multiGet (Query query , Class <T > clazz ) {
304
302
return multiGet (query , clazz , getIndexCoordinatesFor (clazz ));
0 commit comments