sagacity-sqltoy
sagframe/sagacity-sqltoy · Public GitHub repository
Java ORM alternative to MyBatis & Hibernate: JPA-style CRUD + SQL-first queries. Dynamic conditions without <if> blocks; one SQL across 25 databases (auto dialect & function adaptation); self-optimizing pagination; cache translate (no dictionary JOINs); race-proof updateFetch ledgers; sharding, multi-tenancy, data masking. In production since 2008.
Open the project to try its demo, view the repository, or save it to your collection. Repository and demo actions use RepoShelf’s sign-in flow.

About this project
Author-written excerpt from the project README.
JPA-style object CRUD + SQL-first querying — one SQL across 25 databases.
SqlToy is a Java ORM for applications that need both convenient object-based data access and the full power of SQL. Open source and in production since 2008; runs on JDK 17+ with Spring Boot 3/4 (a JDK 8 line is maintained for legacy systems), and compiles to a GraalVM Native Image for cloud-native and XinChuang (domestic-stack) deployments with instant startup and a minimal memory footprint.
A 30-second look — optional filters, no branching tags:
- Dynamic SQL without the noise — #[and s.name like :name] is a condition that joins the SQL only when its parameter is set. No / blocks, and the SQL stays copy-paste runnable in any database client.
- Four-layer optimized pagination — intelligent count rewriting, cached counts for identical filters, @fast() page-first joins, and parallel count + fetch.
- Cache translate — resolve codes to names in memory after the query returns; skip the dictionary JOIN on every list page.
- One SQL across 25 databases — automatic function adaptation (nvl → coalesce/ifnull), per-dialect sqlId variants, and replay-against-other-databases verification in tests.
- Race-safe ledgers — updateFetch locks the row, updates against its current values and returns the result in a single database interaction.
Requirements and intended audience
JPA-style object CRUD + SQL-first querying — one SQL across 25 databases.
Not recorded: account, external api key, paid service, self-hosting. Missing information does not mean there are no requirements.
Statements extracted from the author’s documentation · Checked 2026-11-02. Source: https://github.com/sagframe/sagacity-sqltoy/blob/6.0/README.md
Recorded maintenance information
Last recorded source update: 2026-11-23. Saved release: 6.0.9 · 2026-10-22. These dates do not guarantee ongoing maintenance.
- Technologies
- Java
- Licence
- Apache-2.0. Generally permits modification and commercial use, subject to the licence’s notices and conditions.
- Demo check
- A public page loaded on 2026-11-23. This does not test every feature.
Browse related categories
More projects to explore
awesome-selfhosted
awesome-selfhosted/awesome-selfhosted
A list of Free Software network services and web applications which can be hosted on your own servers
awesome-go
avelino/awesome-go
A curated list of awesome Go frameworks, libraries and software
NextChat
ChatGPTNextWeb/NextChat
✨ Zero-config AI chat assistant. No API key needed — sign up and instantly chat with GPT-5, Claude 4, Gemini 2.5, DeepSeek & 100+ top models. Pay-as-you-go saves you more. Available on Web, iOS, macOS, Android, Linux, Windows.
vue-element-admin
PanJiaChen/vue-element-admin
A magical vue admin https://panjiachen.github.io/vue-element-admin