com.jfinal.plugin.activerecord.Db.batchUpdate()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(183)

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

Db.batchUpdate介绍

暂无

代码示例

代码示例来源:origin: ticktack/kungfu

public int batchUpdate(List<? extends Model<?>> list) {
  return Db.batchUpdate(list, list.size()).length;
}

代码示例来源:origin: ticktack/kungfu

public int saveOrUpdate(List<? extends Model<?>> list, boolean flag) {
  if (flag) {
    return Db.batchSave(list, list.size()).length;
  }
  else {
    return Db.batchUpdate(list, list.size()).length;
  }
}

代码示例来源:origin: yjjdick/sdb-mall

@Override
public int updateBatch(Long[] jobIds, int status){
  Map<String, Object> map = new HashMap<>();
  map.put("list", jobIds);
  map.put("status", status);
  List<ScheduleJob> scheduleJobList = new ArrayList<>();
  for (Long jobId : jobIds) {
    ScheduleJob scheduleJob = new ScheduleJob();
    scheduleJob.setJobId(jobId);
    scheduleJob.setStatus(status);
    scheduleJobList.add(scheduleJob);
  }
  Db.batchUpdate(scheduleJobList, scheduleJobList.size());
  return 1;
}

代码示例来源:origin: yjjdick/sdb-mall

@Override
@JFinalTx
public R batchShelf(String[] ids) {
  if(ids == null){
    return R.error("请选择商品");
  }
  Filter filter = new Filter();
  filter.setProperty("sn");
  filter.setOperator(Filter.Operator.in);
  filter.setValue(ids);
  List<Goods> goodsList = this.dao.findByFilter(filter);
  if(goodsList == null){
    return R.error();
  }
  for(Goods good : goodsList){
    good.setIsMarketable(true);
  }
  Db.batchUpdate(goodsList,goodsList.size());
  return R.ok();
}

代码示例来源:origin: yjjdick/sdb-mall

@Override
  @JFinalTx
  public R batchObtained(String[] ids) {
    if(ids == null){
      return R.error("请选择商品");
    }
    Filter filter = new Filter();
    filter.setProperty("sn");
    filter.setOperator(Filter.Operator.in);
    filter.setValue(ids);
    List<Goods> goodsList = this.dao.findByFilter(filter);
    if(goodsList == null){
      return R.error();
    }
    for(Goods good : goodsList){
      good.setIsMarketable(false);
    }
    Db.batchUpdate(goodsList,goodsList.size());
    return R.ok();
  }
}

代码示例来源:origin: yjjdick/sdb-mall

Db.batchUpdate(products, products.size());
} else {
  Db.batchSave(products, products.size());

相关文章