org.springframework.data.mongodb.core.MongoTemplate.setWriteResultChecking()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.springframework.data.mongodb.core.MongoTemplate.setWriteResultChecking()方法的一些代码示例,展示了MongoTemplate.setWriteResultChecking()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MongoTemplate.setWriteResultChecking()方法的具体详情如下:
包路径:org.springframework.data.mongodb.core.MongoTemplate
类名称:MongoTemplate
方法名:setWriteResultChecking

MongoTemplate.setWriteResultChecking介绍

[英]Configures the WriteResultChecking to be used with the template. Setting null will reset the default of #DEFAULT_WRITE_RESULT_CHECKING.
[中]将WriteResultChecking配置为与模板一起使用。默认设置35U将写入默认设置35U。

代码示例

代码示例来源:origin: kaaproject/kaa

mongoTemplate.setWriteResultChecking(WriteResultChecking.EXCEPTION);

代码示例来源:origin: bsinno/iot-things-examples

@PostConstruct
public void postConstruct() {
  mongoTemplate.setWriteResultChecking(WriteResultChecking.EXCEPTION);
}

代码示例来源:origin: bsinno/iot-things-examples

@PostConstruct
public void start() {
  mongoTemplate.setWriteResultChecking(WriteResultChecking.EXCEPTION);
  if (!mongoTemplate.collectionExists("history")) {
    mongoTemplate.createCollection("history");
  }
  Thread thread = new Thread(this);
  thread.start();
  LOGGER.info("Historian collector started");
}

代码示例来源:origin: com.bq.oss.lib/mongodb

@Override
@Bean
public MongoTemplate mongoTemplate() throws Exception {
  MongoTemplate template = super.mongoTemplate();
  template.setWriteResultChecking(getWriteResultChecking());
  return template;
}

代码示例来源:origin: io.corbel.lib/mongodb

@Override
@Bean
public MongoTemplate mongoTemplate() throws Exception {
  MongoTemplate template = super.mongoTemplate();
  template.setWriteResultChecking(getWriteResultChecking());
  return template;
}

相关文章