Spring Data JPA for Spring Boot 4

    2

    Production-grade persistence guidance for Spring Boot 4, Jakarta Persistence 3.2, and Hibernate 7.

    Free

    3 usesSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Listed1 month ago

    What's inside

    Frequently Asked Questions

    This skill provides production-grade guidance for designing and reviewing persistence layers using the latest Spring Boot 4 stack, specifically targeting Jakarta Persistence 3.2 and Hibernate 7. It helps developers avoid common pitfalls like N+1 query issues, inefficient entity relationships, and incorrect transaction management.

    Yes, the skill is specifically designed to handle migrations from older javax.persistence (J2EE/Java EE) namespaces to the modern Jakarta Persistence 3.2 standards. It provides clear patterns for updating entity mappings and repository contracts to ensure compatibility with Spring Boot 4.

    The skill is compatible with any AI agent that supports custom system instructions or tool integration, such as ChatGPT, Claude, or GitHub Copilot. Simply integrate the provided documentation and patterns into your agent's context to start generating or reviewing code.

    You will receive optimized entity modeling patterns, reusable base entities for assigned IDs, repository design strategies, DTO projection guides, and testing templates that validate real SQL behavior. It also includes a specialized 'mistake-check' guide to identify common errors generated by standard AI coding assistants.

    The skill is open-source under the MIT License, and the primary source is maintained on GitHub. This ensures that the skill receives community-driven updates as Spring Boot 4 and Hibernate 7 continue to evolve.

    New in APIs & Backend

    Free