- Home
- Skills
- APIs & Backend
- Spring Data JPA for Spring Boot 4
Spring Data JPA for Spring Boot 4
Production-grade persistence guidance for Spring Boot 4, Jakarta Persistence 3.2, and Hibernate 7.
Free
Works with the AI Agents you already use
Spring Data JPA for Spring Boot 4
Example session with this skill installed
Review this Spring Boot 4 order persistence layer. Fix its entity relationships, eliminate the N+1 queries on the order list endpoint, preserve the existing database schema, and add focused repository tests.
- Read your context and instructions
- Compiled the spring data jpa
Persistence review
The agent first inspects the entities, repository queries, migrations, transaction boundaries, serialization layer, and existing tests. It preserves the current table and column contract instead of replacing the model with generic templates.
Findings
- The order list loads customer and line data lazily outside a defined fetch plan, producing repeated queries.
- Bidirectional relationships lack clear ownership and helper methods, so both sides can drift out of sync.
- Entity equality depends on generated identifiers before persistence.
- The controller returns entities directly, making lazy loading and JSON serialization part of the API contract.
- The repository test uses mocks and cannot reveal generated SQL or mapping defects.
Deliverables
- Explicit relationship ownership, cascade choices, orphan-removal behavior, and bounded collection access.
- A repository query or entity graph tailored to the list use case without applying eager fetching globally.
- A DTO projection that preserves the endpoint response while keeping persistence entities internal.
- Pagination with deterministic ordering and no collection fetch-join count errors.
- DataJpaTest coverage for mapping constraints, optimistic locking, query counts, pagination, and the selected fetch plan.
Verification
Run the repository tests against the project's supported database profile, inspect the generated SQL for the list query, and compare query counts for one order and a multi-order page. Confirm that migrations remain unchanged unless a schema defect is explicitly identified.
Connects securely to your tools. The creator never sees your data.
About this skill
Design and review Spring Boot 4 persistence code using Jakarta Persistence 3.2, Hibernate 7, and Spring Data JPA. The skill covers entity modeling, identifier strategies, relationships, repositories, DTO projections, query behavior, N+1 prevention, pagination, batching, persistence tests, and frequent agent-generated mistakes. It includes practical entity examples and a reusable assigned-ID base entity.
Use it when building a new persistence layer, reviewing an existing data model, migrating older javax.persistence code, or diagnosing query and transaction behavior. It favors explicit mappings, bounded fetch plans, repository contracts, and tests that expose real SQL behavior.
Open source under the MIT License. GitHub is the primary source: https://github.com/rrezartprebreza/spring-boot-skills
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Requires Spring Boot 4 / Hibernate 7. Optimized for Jakarta Persistence, not legacy javax namespaces. Does not cover NoSQL Spring Data modules.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
3 uses
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 1 month ago
- Free with an Agensi account
Permissions
No special permissions declared or detected