DATACMNS-1208 - AbstractMappingContext.hasPersistentEntityFor(…) now properly considers cached absence.

AbstractMappingContext.hasPersistentEntityFor(…) now also properly consideres the empty Optional as non-presence as that is held to allow to distinguish between a type completely unkown to the context, or already known but not considered a persistent entity.

Related pull request: #258.
This commit is contained in:
Oliver Gierke
2017-11-14 09:56:37 +01:00
parent 5d0cd54a94
commit d8cea8ba1c
2 changed files with 13 additions and 1 deletions

View File

@@ -181,7 +181,9 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
Assert.notNull(type, "Type must not be null!");
return persistentEntities.containsKey(ClassTypeInformation.from(type));
Optional<E> entity = persistentEntities.get(ClassTypeInformation.from(type));
return entity == null ? false : entity.isPresent();
}
/*