• JAVA 深拷贝 oralce in 1000处理


    public static String GetInClause(String field, List<String> valueList){
            if(valueList.size()==0){
                return " ";
            }
    
            Supplier<Stream<String>> idList = ()->valueList.stream().map((x) ->
            {
    //            if (x.matches("[^a-zA-Z0-9-]")) //sql注入检查
    //            {
    //
    //            }
                return String.format("'%1$s'", x);
            });
            var ret=" ";
            int pageSize = 900;
            int pageNum = 0;
            while (pageNum * pageSize < valueList.size())
            {
                List<String> list = idList.get().skip(pageSize*pageNum).limit(pageSize).collect(Collectors.toList());
                ret+= " or "+field+" in (" + String.join(",", list) + ") ";
                pageNum++;
            }
            return ret;
    
        }
        public static Object DeepCopy(Object src){
            try{
                ByteArrayOutputStream bos = new ByteArrayOutputStream();
                ObjectOutputStream out = new ObjectOutputStream(bos);
                out.writeObject(src);
                out.flush();
                out.close();
    
                ByteArrayInputStream bis = new  ByteArrayInputStream(bos.toByteArray());
                ObjectInputStream in = new ObjectInputStream(bis);
                Object toBean = in.readObject();
                in.close();
                return toBean;
    
            }catch (Exception e){
                throw new  FITVException("FI_TV_PUB_9999", e.getMessage());
            }
        }

    除使用字节流外,还可以使用序列化

  • 相关阅读:
    时间随手记
    laravel简书(2)
    laravel简书(1)
    <<Design Patterns>> Gang of Four
    计算机网络你还懵逼吗?持续更新!!!
    poj3126 搜索
    POJ 1426 搜索进阶
    CodeForces 660D
    poj3279搜索详解
    bfs简单题-poj2251
  • 原文地址:https://www.cnblogs.com/wolbo/p/13223496.html
Copyright © 2020-2023  润新知