DEV.co
Open-Source Databases · Blazebit

blaze-persistence

Blaze-Persistence is a Java library that extends JPA with a more powerful Criteria API for building database queries. It adds support for advanced SQL features like CTEs, set operations, and keyset pagination while maintaining compatibility with standard JPA providers.

Source: GitHub — github.com/Blazebit/blaze-persistence
855
GitHub stars
106
Forks
Java
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryBlazebit/blaze-persistence
OwnerBlazebit
Primary languageJava
LicenseApache-2.0 — OSI-approved
Stars855
Forks106
Open issues346
Latest release1.6.18 (2026-02-01)
Last updated2026-06-23
Sourcehttps://github.com/Blazebit/blaze-persistence

What blaze-persistence is

A query builder framework for JPA that layers on Hibernate, EclipseLink, and other JPA providers to expose advanced SQL capabilities (CTEs, RETURNING clauses, VALUES, UNION/EXCEPT/INTERSECT) through a fluent API. Includes Entity-View projection support and Spring Data/DeltaSpike Data integration modules.

Quickstart

Get the blaze-persistence source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/Blazebit/blaze-persistence.gitcd blaze-persistence# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Complex reporting queries with CTEs and set operations

Build recursive CTEs, UNION/EXCEPT/INTERSECT queries, and leverage DML-in-CTE patterns for advanced reporting without raw SQL or stored procedures.

High-performance pagination at scale

Replace offset-based pagination with keyset pagination for stable, performant traversal of large result sets without the O(n) cost of OFFSET.

Projection and DTO mapping via Entity-Views

Define query projections declaratively without manual DTO construction, with automatic fetching optimization and type-safe result mapping.

Implementation considerations

  • Requires JPA 2.0 minimum; Java 8+ recommended for most integrations (Hibernate 5.2+, Spring Data 2.0+). Java 21 tested; ensure JAXB/JTA APIs available on Java 11+.
  • Modular design: choose core, Entity-View, JPA-Criteria, and Spring Data/DeltaSpike modules independently; use BOM for version alignment.
  • Metamodel generation is compile-time; relies on annotation processors (javax.persistence.metamodel); ensure build config supports this.
  • Database dialect support varies: CTE and RETURNING features depend on underlying DB and JPA provider (Hibernate dialect configuration critical).
  • Test against target JPA provider and database early; some advanced features may require specific provider versions or configurations.

When to avoid it — and what to weigh

  • Minimal or greenfield projects with simple CRUD — If your queries are basic SELECT/INSERT/UPDATE/DELETE without complex joins or reporting, standard JPA or Spring Data suffices; Blaze adds unnecessary complexity.
  • Non-JPA data sources or polyglot persistence — Blaze is tightly coupled to JPA providers; it cannot abstract over NoSQL, graph, or non-relational stores.
  • Teams unfamiliar with JPA or SQL semantics — The fluent API assumes solid understanding of relational concepts and JPA metamodel generation; steep learning curve for junior teams.
  • Strict vendor-neutral requirements — While claimed as JPA-provider-agnostic, some advanced features (CTEs, RETURNING) depend on database dialect support; not all databases/providers are equal.

License & commercial use

Apache License 2.0 (Apache-2.0). Permissive OSI-approved license allowing commercial use, modification, and distribution with minimal restrictions (attribution and notice of changes required).

Commercial use is permitted under Apache 2.0. No proprietary dependencies or restrictions noted in provided data. Verify that all transitive JPA provider licenses (Hibernate, EclipseLink, etc.) align with your commercial use terms, as Blaze is a library layered atop them.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Blaze-Persistence is a query builder and does not introduce novel security primitives. Standard JPA/SQL injection risks apply: parameterized queries and named parameters (supported) mitigate SQL injection. No explicit encryption, audit logging, or access control documented; rely on underlying JPA provider and database security. Review provider's security advisories (e.g., Hibernate CVEs) as Blaze depends on them.

Alternatives to consider

Spring Data JPA / Querydsl

Industry standard for type-safe JPA queries with smaller ecosystem footprint; better for simple-to-moderate complexity. Querydsl's APT-based type generation avoids some Blaze bootstrapping overhead.

jOOQ

Database-first, code-generation approach with superior support for advanced SQL (CTEs, window functions, dialects). Type-safe and database-agnostic, but heavier upfront cost and less JPA-integrated.

Raw JPA Criteria API + native queries

Lower-level, zero dependencies beyond JPA. Suitable if your use cases are simple; native SQL for complex reporting. More boilerplate, no abstraction over database differences.

Software development agency

Build on blaze-persistence with DEV.co software developers

Evaluate Blaze-Persistence for your Java backend if you need CTEs, keyset pagination, or projection mapping. Start with a Spring Boot or Core archetype and test against your JPA provider and database.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

blaze-persistence FAQ

Does Blaze-Persistence work with Spring Boot?
Yes. Spring Data integration is provided, and a Spring Boot archetype is available. Import the BOM and Spring Data module, configure JPA provider as normal, and extend repositories with Blaze builders.
Can I use Blaze with Hibernate 6+?
Unknown from provided data. README shows Hibernate 4.2+ listed but does not explicitly confirm Hibernate 6 or Jakarta EE 9+ compatibility. Requires review of release notes or community channels.
What databases support CTEs and RETURNING clauses?
CTE support: PostgreSQL, Oracle, SQL Server, MySQL 8+. RETURNING: PostgreSQL, Oracle (limited), others vary. Blaze relies on JPA provider dialect; confirm provider and database version before use.
Is Entity-View similar to DTOs or database views?
Conceptually yes: Entity-Views are projections defined in code and mapped to query results, analogous to SQL views. Automatic fetch optimization and lazy-loading support reduce N+1 issues vs. manual DTO construction.

Software development & web development with DEV.co

DEV.co helps companies turn open-source tools like blaze-persistence into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source databases stack.

Ready to simplify complex JPA queries?

Evaluate Blaze-Persistence for your Java backend if you need CTEs, keyset pagination, or projection mapping. Start with a Spring Boot or Core archetype and test against your JPA provider and database.