pojo
@Table("test_insert")
public class TestPojo {
@Name
private String id;
@Column
private String name;
@Column
private String nickName;
@Column
private String uname;
public TestPojo() {
super();
}
public TestPojo(String id) {
super();
this.id = id;
this.name = id;
this.nickName = id;
this.uname = id;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getUname() {
return uname;
}
public void setUname(String uname) {
this.uname = uname;
}
}
测试代码
dao.create(TestPojo.class, false);
for (int i = 0; i < 2000; i++) {
List<TestPojo> add = new ArrayList<TestPojo>();
for (int j = 0; j < 500; j++) {
add.add(new TestPojo(R.UU32()));
}
long time = System.currentTimeMillis();
dao.fastInsert(add);
System.out.println(i + " time = " + (System.currentTimeMillis() - time));
add.clear();
}