mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
d675b7376d
commit
3acf9c4e70
@ -19,17 +19,19 @@ import cn.hutool.log.StaticLog;
|
|||||||
public class DbTest {
|
public class DbTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void findTest() throws SQLException {
|
public void queryTest() throws SQLException {
|
||||||
Db.use();
|
List<Entity> find = Db.use().query("select * from user where age = ?", 18);
|
||||||
|
Assert.assertEquals("王五", find.get(0).get("name"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void findTest() throws SQLException {
|
||||||
List<Entity> find = Db.use().find(Entity.create("user").set("age", 18));
|
List<Entity> find = Db.use().find(Entity.create("user").set("age", 18));
|
||||||
Assert.assertEquals("王五", find.get(0).get("name"));
|
Assert.assertEquals("王五", find.get(0).get("name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void findByTest() throws SQLException {
|
public void findByTest() throws SQLException {
|
||||||
Db.use();
|
|
||||||
|
|
||||||
List<Entity> find = Db.use().findBy("user",
|
List<Entity> find = Db.use().findBy("user",
|
||||||
Condition.parse("age", "> 18"),
|
Condition.parse("age", "> 18"),
|
||||||
Condition.parse("age", "< 100")
|
Condition.parse("age", "< 100")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user