add SetUtil

This commit is contained in:
Looly
2022-05-07 12:18:29 +08:00
parent ab0448e0fd
commit 029a603d5f
56 changed files with 434 additions and 625 deletions

View File

@@ -1,6 +1,6 @@
package cn.hutool.db;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.map.MapUtil;
import cn.hutool.db.handler.EntityListHandler;
@@ -107,7 +107,7 @@ public class CRUDTest {
@Test
public void findTest() {
final List<Entity> find = db.find(CollUtil.newArrayList("name AS name2"), Entity.create("user"), new EntityListHandler());
final List<Entity> find = db.find(ListUtil.toList("name AS name2"), Entity.create("user"), new EntityListHandler());
Assert.assertFalse(find.isEmpty());
}
@@ -168,7 +168,7 @@ public class CRUDTest {
Console.log(data1);
Console.log(data2);
final int[] result = db.insert(CollUtil.newArrayList(data1, data2));
final int[] result = db.insert(ListUtil.toList(data1, data2));
Console.log(result);
}
@@ -185,7 +185,7 @@ public class CRUDTest {
Console.log(data1);
final int[] result = db.insert(CollUtil.newArrayList(data1));
final int[] result = db.insert(ListUtil.toList(data1));
Console.log(result);
}

View File

@@ -1,6 +1,6 @@
package cn.hutool.db;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.db.handler.EntityListHandler;
@@ -31,7 +31,7 @@ public class ConcurentTest {
for(int i = 0; i < 10000; i++) {
ThreadUtil.execute(() -> {
final List<Entity> find;
find = db.find(CollUtil.newArrayList("name AS name2"), Entity.create("user"), new EntityListHandler());
find = db.find(ListUtil.toList("name AS name2"), Entity.create("user"), new EntityListHandler());
Console.log(find);
});
}

View File

@@ -1,6 +1,6 @@
package cn.hutool.db.meta;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.SetUtil;
import cn.hutool.core.text.StrUtil;
import cn.hutool.db.ds.DSFactory;
import org.junit.Assert;
@@ -27,7 +27,7 @@ public class MetaUtilTest {
@Test
public void getTableMetaTest() {
final Table table = MetaUtil.getTableMeta(ds, "user");
Assert.assertEquals(CollUtil.newHashSet("id"), table.getPkNames());
Assert.assertEquals(SetUtil.newHashSet("id"), table.getPkNames());
}
@Test