mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-19 00:15:19 +00:00
chore[orm]: log
This commit is contained in:
1 parent
90cb1b0319
commit
c91e4f6f08
1 file changed
+4
-4
@@ -65,8 +65,8 @@ public class MongodbAccessor implements IAccessor {
|
|||||||
|
|
||||||
var result = collection.replaceOne(filter, entity);
|
var result = collection.replaceOne(filter, entity);
|
||||||
if (result.getMatchedCount() <= 0) {
|
if (result.getMatchedCount() <= 0) {
|
||||||
// 数据库中没有这个id或者需要更新的数据和数据库中的相同
|
// 数据库中没有这个id
|
||||||
logger.warn("database:[{}] 1.[_id:{}] not exist or 2. update entity is equal with database entity", entityClazz.getSimpleName(), entity.id());
|
logger.warn("database:[{}] [_id:{}] not exist", entityClazz.getSimpleName(), entity.id());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -93,8 +93,8 @@ public class MongodbAccessor implements IAccessor {
|
|||||||
|
|
||||||
var result = collection.bulkWrite(batchList, new BulkWriteOptions().ordered(false));
|
var result = collection.bulkWrite(batchList, new BulkWriteOptions().ordered(false));
|
||||||
if (result.getMatchedCount() != entities.size()) {
|
if (result.getMatchedCount() != entities.size()) {
|
||||||
// 在数据库的批量更新操作中需要更新的数量和最终更新的数量不相同(大部分原因都是因为需要更新的文档和数据库的文档相同)
|
// 在数据库的批量更新操作中需要更新的数量和最终更新的数量不相同
|
||||||
logger.warn("database:[{}] update size:[{}] not equal with matched size:[{}](Most of the reasons is that update entity is equal with database entity)"
|
logger.warn("database:[{}] update size:[{}] not equal with matched size:[{}](some entity of id not exist in database)"
|
||||||
, entityClazz.getSimpleName(), entities.size(), result.getMatchedCount());
|
, entityClazz.getSimpleName(), entities.size(), result.getMatchedCount());
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
|||||||
Reference in new issue
Block a user