zoukankan      html  css  js  c++  java
  • Java list分割批量处理

    private final static int INIT = 300;
    
    int size = update.size();
    int temptStart, temptEnd;
    List<AssetsInfo> result;
    for (int i = 0; ; i++) {
    temptStart = i * INIT;
    temptEnd = temptStart + INIT;
    if(temptEnd > size){
    result = update.subList(temptStart, size);
    assetsInfoService.updateOrgRelatBathById(result);
    break;
    }
    result = update.subList(temptStart, temptEnd);
    assetsInfoService.updateOrgRelatBathById(result);
    }
  • 相关阅读:
    二维数组
    数组经典排序
    数组复制方法
    循环
    方法和包
    switch

    注释
    面向对象优点
    有参
  • 原文地址:https://www.cnblogs.com/liuzhengkun/p/14377907.html
Copyright © 2011-2022 走看看