Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4XrpfdpsacrvqnrBM
2.0 KiB
2.0 KiB
Jakarta Data repositories on Hibernate, compared with Spring Data JPA
Runnable companion to the ankurm.com post on Jakarta Data with Hibernate (@Find, @Query, @Select) and how it compares
with Spring Data JPA. Every transcript in output/ is written by a test that asserts the same facts; the post quotes those files verbatim.
Versions and status (checked against Maven Central on 2026-11-26)
| Profile | Hibernate ORM | Jakarta Data API | Status |
|---|---|---|---|
ga (default) |
7.4.17.Final | 1.0.2 | GA |
h8 (-Ph8) |
8.0.0.CR2 (24 Nov 2026) | 1.1.0-M4 | pre-release; Jakarta Data 1.1 is not final |
spring-data module |
Spring Boot 4.2.0, Spring Data JPA 4.2.0, Hibernate 7.4.15.Final (Boot-managed) | n/a | GA |
JDK Temurin 25.0.5.1, H2 2.5.252, JUnit 6.1.3, Maven 3.9.11. @Select, @Is and @First exist only in Jakarta Data 1.1.0-M4.
Run
./scripts/run-all.sh # regenerates all of output/ (needs JDK 25, Maven, network)
cd hibernate-data && mvn test # GA line
cd hibernate-data && mvn -Ph8 test # Hibernate 8 CR2 + Jakarta Data 1.1.0-M4
./scripts/broken.sh ga|h8 # compile-time errors for the files in hibernate-data/src/broken
cd spring-data && mvn test # the Spring Data JPA comparison
Layout
| Path | What it is |
|---|---|
hibernate-data/src/main/java/com/ankurm/data/ |
Book, Library (@Find/@Query), StatefulLibrary (EntityManager-backed) |
hibernate-data/src/h8/java/ |
Catalog (@Select, @Is, @First), compiled only with -Ph8 |
hibernate-data/src/test/ , src/test-h8/ |
Lab (boots Hibernate, records SQL), Transcript, the tests |
hibernate-data/src/broken/ |
repositories that must NOT compile; driven by scripts/broken.sh |
spring-data/src/main/java/com/ankurm/sd/ |
BookRepository and the two projection types |
output/ga, output/h8, output/spring |
captured output; output/00-version-check.txt is the Maven Central check |