项目用的 Mybatis,今天改一个需求,落地实现是批量更新,且只需要根据主键(id)来更新一个字段(name). 于是,没有犹豫,像下面这样设计了数据结构: 既然是批量更新,那外层肯定是 List List 中每个元素,只包含 id & name,于是,选择了用 org.apache.commons.lang3.tuple.Pair 来封装数据(就是不想自己再写一个 DO 或者 VO 或者 MO) 最终的数据结构是:List<Pair<Integer, String>>…
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; class test { { Console.WriteLine("1:__" + "Method调用成功!"); } { Console.WriteLine("2:__" + str); } { string classNam…
本实例是元类实例,功能是记录该的子类的类名,并以树状结构展示子类的类名. RegisterClasses继承自type,提供的功能是在__init__接口,为类创建了childrens的集合,并类名保存到对应的父类元组的childrens的集合中. 同时对__str__打印方法和__iter__迭代方法进行了定义,其中: __iter__方法返回类名的childrens集合,并对其中的元素进行输入. 而Sharp继承自RegisterClasses, 当 for s in Sharp: prin…