BulkOperations bulkOps = mongoOperations.bulkOps(BulkOperations.BulkMode.ORDERED, entityInformation.getJavaType());
// add "save" operation for each entity
MongoConverter converter = mongoOperations.getConverter();
ConversionService conversionService = converter.getConversionService();
com.mongodb.DBObject dbObject;
for (S entity : entities) {
if (entityInformation.isNew(entity)) { // --- if NEW entity, then generate id and INSERT ---
// generate NEW id
ID id = conversionService.convert(new ObjectId(), entityInformation.getIdType());
entity.setId(id);
// insert
bulkOps.insert(entity);
} else { // --- if EXISTING entity, then UPSERT ---
// convert entity to mongo DBObject
dbObject = new BasicDBObject();
// NULL fields will NOT BE UPDATED - will be ignored when converting an entity to a {@link com.mongodb.DBObject}
// and thus they will not be added to the {@link Update} statement.
converter.write(entity, dbObject);
// upsert
bulkOps.upsert(new Query(Criteria.where(UNDERSCORE_ID).is(dbObject.get(UNDERSCORE_ID))),
Update.fromDBObject(new BasicDBObject("$set", dbObject)));
}
}
// execute bulk operations
bulkOps.execute();
我从其他程序集的控制器调用accountHolderAppService的FullName函数。
发生以下错误。
无法加载文件或程序集' Phoenix.AccountHolders'或其中一个依赖项。系统找不到指定的文件。