Web Analytics

uni-pagination

⭐ 191 stars English by taoganio

🌐 Language

Uni-Pagination Pagination Framework

Uni Pagination is a Java-based universal pagination framework that provides a unified pagination query interface for different data sources through an abstracted design. The framework adopts a modular architecture and currently integrates various data sources such as JDBC, Mybatis, MongoDB, Elasticsearch, and offers a flexible extension mechanism.

Core Design

The core design of the framework revolves around four key components:

Design Goals

Applicable Scenarios

Core Modules

uni-pagination

Core pagination library, providing basic pagination interfaces and abstract implementations.

uni-pagination-jdbc

JDBC data source support module, providing JDBC-based pagination implementation.

uni-pagination-jdbc-mybatis

MyBatis integration module, providing integration support with the MyBatis framework.

uni-pagination-mongodb

MongoDB integration component, used to support pagination queries for MongoDB.

spring-boot-starter-web-uni-pagination

Pagination support module under Spring MVC environment, providing integration support with Spring MVC, as simple as writing ordinary controllers.

web-uni-pagination-test

Pagination test module under Spring Boot Web environment, providing integration tests for pagination functionality.

Quick Start, using uni-pagination-jdbc as an example

Maven Dependency


   io.github.taoganio
   uni-pagination-jdbc
   1.0.0

Simple Example

public class PaginationTest {
   
    public void page() {
        PaginationStatementTemplate operations = new PaginationStatementTemplate();
        operations.addStatementExecutor(new Sql2oPaginationNamedParameterStatementExecutor(dataSource));
        
        // 1. 创建分页语句
        PaginationStatement statement = of(b -> b
                .sql("SELECT * FROM user WHERE username LIKE :username")
                .paramMap("username", "%admin%")
                .pageable(0, 10)
                .sort("id", Sort.Direction.DESC));
        
        // 2. 执行查询
        PageInformation information = operations.queryForInformation(statement);
        Page page = operations.queryForResultSet(statement, new JdbcBeanPropertyPaginationRowMapper<>(User.class));
    }

// User实体类 class User { private Long id; private String username; // getters and setters } }

Acknowledgments

During the development of this framework, I was deeply influenced and inspired by the open-source community. Thanks to those experts who selflessly share their technical experience; it is your wisdom and contributions that made this framework possible. Special thanks to the excellent open-source projects that provided design inspiration and implementation ideas; these valuable experiences allow me to stand on the shoulders of giants and keep moving forward.

Thanks to all the technical experts who have contributed to the open-source community!

🌟 Support the Project

If you find this project helpful, please click the ⭐Star at the top right to support me!

--- Tranlated By Open Ai Tx | Last indexed: 2025-12-17 ---