fix pr#1023

This commit is contained in:
Looly
2023-06-19 16:03:10 +08:00
parent 7026184fa3
commit e1b6ebd1ac
3 changed files with 161 additions and 160 deletions

View File

@@ -36,7 +36,6 @@ import java.util.Set;
* ANSI SQL 方言 * ANSI SQL 方言
* *
* @author loolly * @author loolly
*
*/ */
public class AnsiSqlDialect implements Dialect { public class AnsiSqlDialect implements Dialect {
private static final long serialVersionUID = 2088101129774974580L; private static final long serialVersionUID = 2088101129774974580L;

View File

@@ -137,31 +137,33 @@ public class DbTest {
} }
@Test @Test
public void batchInsert() throws SQLException { @Disabled
List<Entity> es = new ArrayList<>(); public void batchInsertTest() throws SQLException {
String tableName = "act_ge_property"; final List<Entity> es = new ArrayList<>();
Entity e = buildEntity(tableName); final String tableName = "act_ge_property";
final Entity e = buildEntity();
es.add(e); es.add(e);
Db.of().tx(db -> { Db.of().tx(db -> {
db.insert(es); db.insert(es);
List<Entity> ens = Db.of().find(e); final List<Entity> ens = Db.of().find(e);
Assertions.assertEquals(1, ens.size()); Assertions.assertEquals(1, ens.size());
db.del(tableName, "NAME_", "!= null"); db.del(tableName, "NAME_", "!= null");
}); });
} }
@Test @Test
@Disabled
public void batchInsertBatch() throws SQLException { public void batchInsertBatch() throws SQLException {
List<Entity> es = new ArrayList<>(); final List<Entity> es = new ArrayList<>();
String tableName = "act_ge_property"; final String tableName = "act_ge_property";
Entity e = buildEntity(tableName); final Entity e = buildEntity();
es.add(e); es.add(e);
es.add(buildEntity(tableName)); es.add(buildEntity());
es.add(buildEntity(tableName)); es.add(buildEntity());
es.add(buildEntity(tableName)); es.add(buildEntity());
Db.of().tx(db -> { Db.of().tx(db -> {
db.insert(es); db.insert(es);
List<Entity> ens = Db.of().find(e); final List<Entity> ens = Db.of().find(e);
Assertions.assertEquals(1, ens.size()); Assertions.assertEquals(1, ens.size());
db.del(tableName, "NAME_", "!= null"); db.del(tableName, "NAME_", "!= null");
}); });
@@ -169,8 +171,8 @@ public class DbTest {
} }
private Entity buildEntity(String tableName) { private Entity buildEntity() {
Entity entity = Entity.of("act_ge_property"); final Entity entity = Entity.of("act_ge_property");
entity.put("NAME_", RandomUtil.randomString(15)); entity.put("NAME_", RandomUtil.randomString(15));
entity.put("VALUE_", RandomUtil.randomString(50)); entity.put("VALUE_", RandomUtil.randomString(50));
entity.put("REV_", RandomUtil.randomInt()); entity.put("REV_", RandomUtil.randomInt());

Binary file not shown.