mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -36,12 +36,22 @@ public class DbTest {
|
||||
// 测试数据库中一共4条数据,第0页有3条,第1页有1条
|
||||
final List<Entity> page0 = Db.of().page(Entity.create("user"), Page.of(0, 3));
|
||||
Assert.assertEquals(3, page0.size());
|
||||
|
||||
final List<Entity> page1 = Db.of().page(Entity.create("user"), Page.of(1, 3));
|
||||
Assert.assertEquals(1, page1.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pageTest2() {
|
||||
final long count = Db.of().count(Entity.create("user"), Page.of(1, 3));
|
||||
Assert.assertEquals(1, count);
|
||||
|
||||
final List<Entity> page1 = Db.of().page(Entity.create("user"), Page.of(1, 3));
|
||||
Assert.assertEquals(1, page1.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pageBySqlTest() {
|
||||
final String sql = "select * from user order by name";
|
||||
// 测试数据库中一共4条数据,第0页有3条,第1页有1条
|
||||
final List<Entity> page0 = Db.of().page(
|
||||
|
Reference in New Issue
Block a user