How Bean Searcher Lets You Build Complex Queries with One Line of Code

Bean Searcher is an open‑source, Apache‑2.0 licensed ORM search engine that outperforms MyBatis by up to 100×, offering one‑line multi‑table joins, pagination, dynamic sorting, field aggregation, and extensive extensibility, with simple Spring Boot integration and customizable components for rapid backend development.

Su San Talks Tech
Su San Talks Tech
Su San Talks Tech
How Bean Searcher Lets You Build Complex Queries with One Line of Code

Open‑source Project Overview

Bean Searcher is a read‑only ORM search engine that is up to 100 times faster than MyBatis for conditional retrieval, natively supports multi‑table joins, and eliminates the need for DTO/VO conversion, enabling complex list queries with a single line of code.

License

Apache‑2.0

Key Features

Entity multi‑table mapping

Dynamic field operators

Group aggregation queries

Support for sub‑queries (Select | Where | From)

Embedded parameters in entity classes

Field converters

SQL interceptors

Database dialect extensions

Multiple and dynamic data sources

Default and custom annotations

Extensible field operators

Quick Development

Using Bean Searcher can dramatically reduce development time for complex list‑retrieval APIs. Integration with any Java web framework (Spring Boot, Grails, JFinal, etc.) is straightforward.

Integration Example (Spring Boot)

implementation 'com.ejlchina:bean-searcher-boot-starter:3.6.0'

Inject the searcher in a controller or service:

@Autowired
private BeanSearcher beanSearcher;

@GetMapping("/user/index")
public SearchResult<User> index(HttpServletRequest request) {
    // One line of code performs the search
    return beanSearcher.search(User.class, MapUtils.flat(request.getParameterMap()), new String[]{"age"});
}

Parameter Builder

Map<String, Object> params = MapUtils.builder()
    .selectExclude(User::getJoinDate) // exclude joinDate
    .field(User::getStatus, 1) // status = 1
    .field(User::getName, "Jack").ic() // name = 'Jack' (case‑ignored)
    .field(User::getAge, 20, 30).op(Opetator.Between) // age between 20 and 30
    .orderBy(User::getAge, "asc") // sort by age asc
    .page(0, 15) // page 0, 15 items per page
    .build();
List<User> users = beanSearcher.searchList(User.class, params);

Extensibility

Bean Searcher is designed with interfaces, allowing users to customize any component, such as field operators, field converters, DB mappings, parameter resolvers, and dialects to support additional databases.

Supported Images

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaSpring BootORM
Su San Talks Tech
Written by

Su San Talks Tech

Su San, former staff at several leading tech companies, is a top creator on Juejin and a premium creator on CSDN, and runs the free coding practice site www.susan.net.cn.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.