mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix pr#1023
This commit is contained in:
@@ -36,7 +36,6 @@ import java.util.Set;
|
||||
* ANSI SQL 方言
|
||||
*
|
||||
* @author loolly
|
||||
*
|
||||
*/
|
||||
public class AnsiSqlDialect implements Dialect {
|
||||
private static final long serialVersionUID = 2088101129774974580L;
|
||||
|
@@ -137,31 +137,33 @@ public class DbTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void batchInsert() throws SQLException {
|
||||
List<Entity> es = new ArrayList<>();
|
||||
String tableName = "act_ge_property";
|
||||
Entity e = buildEntity(tableName);
|
||||
@Disabled
|
||||
public void batchInsertTest() throws SQLException {
|
||||
final List<Entity> es = new ArrayList<>();
|
||||
final String tableName = "act_ge_property";
|
||||
final Entity e = buildEntity();
|
||||
es.add(e);
|
||||
Db.of().tx(db -> {
|
||||
db.insert(es);
|
||||
List<Entity> ens = Db.of().find(e);
|
||||
final List<Entity> ens = Db.of().find(e);
|
||||
Assertions.assertEquals(1, ens.size());
|
||||
db.del(tableName, "NAME_", "!= null");
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void batchInsertBatch() throws SQLException {
|
||||
List<Entity> es = new ArrayList<>();
|
||||
String tableName = "act_ge_property";
|
||||
Entity e = buildEntity(tableName);
|
||||
final List<Entity> es = new ArrayList<>();
|
||||
final String tableName = "act_ge_property";
|
||||
final Entity e = buildEntity();
|
||||
es.add(e);
|
||||
es.add(buildEntity(tableName));
|
||||
es.add(buildEntity(tableName));
|
||||
es.add(buildEntity(tableName));
|
||||
es.add(buildEntity());
|
||||
es.add(buildEntity());
|
||||
es.add(buildEntity());
|
||||
Db.of().tx(db -> {
|
||||
db.insert(es);
|
||||
List<Entity> ens = Db.of().find(e);
|
||||
final List<Entity> ens = Db.of().find(e);
|
||||
Assertions.assertEquals(1, ens.size());
|
||||
db.del(tableName, "NAME_", "!= null");
|
||||
});
|
||||
@@ -169,8 +171,8 @@ public class DbTest {
|
||||
|
||||
}
|
||||
|
||||
private Entity buildEntity(String tableName) {
|
||||
Entity entity = Entity.of("act_ge_property");
|
||||
private Entity buildEntity() {
|
||||
final Entity entity = Entity.of("act_ge_property");
|
||||
entity.put("NAME_", RandomUtil.randomString(15));
|
||||
entity.put("VALUE_", RandomUtil.randomString(50));
|
||||
entity.put("REV_", RandomUtil.randomInt());
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user