diff --git a/nest-ddd/src/main/java/com/zhaofujun/nest/context/appservice/UnitOfWork.java b/nest-ddd/src/main/java/com/zhaofujun/nest/context/appservice/UnitOfWork.java index ad9ffe33..1b0a358b 100644 --- a/nest-ddd/src/main/java/com/zhaofujun/nest/context/appservice/UnitOfWork.java +++ b/nest-ddd/src/main/java/com/zhaofujun/nest/context/appservice/UnitOfWork.java @@ -37,6 +37,7 @@ public T getEntity(Class tClass, Identifier identifier) { Entity entity = entities .stream() .filter(p -> identifier.equals(p.getId()) && tClass.isInstance(p)) + .filter(p->!p.is__deleted()) .findFirst() .orElse(null); return (T) entity; @@ -69,7 +70,7 @@ private void commitEntity() { // s.parallelStream().forEach(ss -> cacheClient.remove(EntityCacheUtils.getCacheKey(ss))); } entityNotify(r, s); - s.parallelStream().forEach(ss -> cacheClient.remove(EntityCacheUtils.getCacheKey(ss))); + s.forEach(ss -> cacheClient.remove(EntityCacheUtils.getCacheKey(ss))); }); });