mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-15 20:16:02 +00:00
chore[orm]: recommend using CopyOnWriteArrayList or ConcurrentHashMap in @EntityCache
This commit is contained in:
1 parent
6d00021b9a
commit
1af2314716
1 file changed
+12
@@ -305,6 +305,18 @@ public class OrmManager implements IOrmManager {
|
||||
var cacheDef = parserEntityDef(entityClass);
|
||||
cacheDefMap.putIfAbsent(entityClass, cacheDef);
|
||||
}
|
||||
|
||||
var unsafeList = cacheDefMap.entrySet()
|
||||
.stream()
|
||||
.filter(it -> !it.getValue().isThreadSafe())
|
||||
.filter(it -> it.getKey().isAnnotationPresent(com.zfoo.orm.anno.EntityCache.class))
|
||||
.map(it -> it.getKey().getSimpleName())
|
||||
.toList();
|
||||
if (CollectionUtils.isNotEmpty(unsafeList)) {
|
||||
logger.info("In order to improve performance, highly recommend using CopyOnWriteArrayList or ConcurrentHashMap in @EntityCache:[{}]"
|
||||
, StringUtils.joinWith(", ", unsafeList.toArray()));
|
||||
}
|
||||
|
||||
return cacheDefMap;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user