fixed Db.paginate

This commit is contained in:
开源海哥 2023-05-17 10:38:52 +08:00
parent e15de1ac9f
commit c8ec84a4d3
2 changed files with 7 additions and 3 deletions

View File

@ -18,7 +18,6 @@ package com.mybatisflex.core.row;
import com.mybatisflex.core.FlexConsts;
import com.mybatisflex.core.exception.FlexExceptions;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.provider.EntitySqlProvider;
import com.mybatisflex.core.provider.RowSqlProvider;
import com.mybatisflex.core.query.CPI;
import com.mybatisflex.core.query.QueryColumn;
@ -198,7 +197,7 @@ public interface RowMapper {
* 更新 entity主要用于进行批量更新的场景
* @param entity 实体类
* @see RowSqlProvider#updateEntity(Map)
* @see RowMapperInvoker#updateBatchEntity(Collection, int)
* @see Db#updateBatchEntity(Collection, int)
*/
@UpdateProvider(value = RowSqlProvider.class, method = "updateEntity")
int updateEntity(@Param(FlexConsts.ENTITY) Object entity);
@ -367,7 +366,7 @@ public interface RowMapper {
* @return 数据列表
* @see RowSqlProvider#selectObjectByQuery(Map)
*/
@SelectProvider(type = EntitySqlProvider.class, method = "selectObjectByQuery")
@SelectProvider(type = RowSqlProvider.class, method = "selectObjectByQuery")
List<Object> selectObjectListByQuery(@Param(FlexConsts.TABLE_NAME) String tableName, @Param(FlexConsts.QUERY) QueryWrapper queryWrapper);

View File

@ -18,6 +18,8 @@ package com.mybatisflex.test;
import com.mybatisflex.core.MybatisFlexBootstrap;
import com.mybatisflex.core.audit.AuditManager;
import com.mybatisflex.core.audit.ConsoleMessageCollector;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.row.Db;
import com.mybatisflex.core.row.Row;
import com.mybatisflex.core.row.RowKey;
@ -48,6 +50,9 @@ public class RowTestStarter {
AuditManager.setAuditEnable(true);
AuditManager.setMessageCollector(new ConsoleMessageCollector());
Page<Row> rowPage = Db.paginate("tb_account", 1, 10, QueryWrapper.create());
System.out.println(rowPage);
//查询 ID 1 的数据
// Row row = Db.selectOneById("tb_account", "id", 1);