mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复Db.findAll全局忽略大小写无效问题
This commit is contained in:
@@ -624,7 +624,7 @@ public abstract class AbstractDb implements Serializable {
|
||||
* @throws SQLException SQL执行异常
|
||||
*/
|
||||
public List<Entity> findAll(Entity where) throws SQLException {
|
||||
return find(where, EntityListHandler.create());
|
||||
return find(where, new EntityListHandler(this.caseInsensitive));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -108,7 +108,7 @@ public class CRUDTest {
|
||||
|
||||
@Test
|
||||
public void findTest() throws SQLException {
|
||||
List<Entity> find = db.find(CollUtil.newArrayList("name AS name2"), Entity.create("user"), new EntityListHandler());
|
||||
List<Entity> find = db.find(CollUtil.newArrayList("name AS name2"), Entity.create("user"), EntityListHandler.create());
|
||||
Assert.assertFalse(find.isEmpty());
|
||||
}
|
||||
|
||||
|
@@ -13,34 +13,34 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* SqlRunner线程安全测试
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
@Ignore
|
||||
public class ConcurentTest {
|
||||
|
||||
|
||||
private Db db;
|
||||
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
db = Db.use("test");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void findTest() {
|
||||
for(int i = 0; i < 10000; i++) {
|
||||
ThreadUtil.execute(() -> {
|
||||
List<Entity> find;
|
||||
try {
|
||||
find = db.find(CollectionUtil.newArrayList("name AS name2"), Entity.create("user"), new EntityListHandler());
|
||||
find = db.find(CollectionUtil.newArrayList("name AS name2"), Entity.create("user"), EntityListHandler.create());
|
||||
} catch (SQLException e) {
|
||||
throw new DbRuntimeException(e);
|
||||
}
|
||||
Console.log(find);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//主线程关闭会导致连接池销毁,sleep避免此情况引起的问题
|
||||
ThreadUtil.sleep(5000);
|
||||
}
|
||||
|
@@ -130,7 +130,7 @@ public class DbTest {
|
||||
ps.setFetchSize(Integer.MIN_VALUE);
|
||||
ps.setFetchDirection(ResultSet.FETCH_FORWARD);
|
||||
return ps;
|
||||
}), new EntityListHandler());
|
||||
}), EntityListHandler.create());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user