A Read‑Only ORM That’s 100× Faster Than MyBatis

BeanSearcher, a read‑only Java ORM, generates SQL from declarative annotations and maps HTTP query parameters directly to query conditions, allowing complex multi‑table, aggregation and sorting queries with a single line of code and claiming performance up to a hundred times faster than MyBatis.

Architect's Tech Stack
Architect's Tech Stack
Architect's Tech Stack
A Read‑Only ORM That’s 100× Faster Than MyBatis

BeanSearcher is a read‑only ORM for Java that focuses on complex list queries such as multi‑condition filtering, multi‑table joins, pagination, sorting, and aggregation. It enables a single entity to map to multiple tables, supports dynamic field operators, group aggregation, sub‑queries, SQL interceptors, multiple data sources, and optional custom annotations.

Technical principle

Declarative annotations are processed at runtime to generate SQL statements, and HTTP request parameters are mapped directly to query conditions. This approach supplements MyBatis’s CRUD capabilities without replacing them, providing a read‑only path for complex queries.

Quick start

Add the Maven dependency to a Spring Boot project:

implementation 'cn.zhxu:bean-searcher-boot-stater:4.8.7'

Inject BeanSearcher into a controller and invoke a single search call:

return beanSearcher.search(User.class,
    MapUtils.flat(request.getParameterMap()),
    new String[]{"age"});

A request such as

?status=1&name=Jack&name-ic=true&sort=age&order=desc

filters by status, performs a case‑insensitive search on name, sorts by age descending, and adds an aggregation of the age field. The same result that would normally require extensive MyBatis XML and mapper code is produced with a single line, which the author claims reduces roughly 80 % of query work to one statement.

Repository

GitHub: https://github.com/troyzhxu/bean-searcher

Conclusion

For Java back‑ends that frequently encounter complex list‑query scenarios, BeanSearcher can compress the majority of query logic into a single call, offering a substantial efficiency gain while remaining a read‑only complement to existing MyBatis usage.

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 BootMyBatisORMRead‑OnlyBeanSearcher
Architect's Tech Stack
Written by

Architect's Tech Stack

Java backend, microservices, distributed systems, containerized programming, and more.

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.