← ClaudeAtlas

spring-data-jpalisted

Use when designing or implementing Spring Data JPA on Spring Boot 4 — repository boundaries, projections, query patterns, custom repositories, CQRS read models, entity relationships, or persistence performance fixes. Not for generic SQL help, database admin work, or project-wide migration (see the springboot-migration skill).
a-pavithraa/springboot-skills-marketplace · ★ 78 · Data & Documents · score 79
Install: claude install-skill a-pavithraa/springboot-skills-marketplace
# Spring Data JPA Implementation ## Purpose Use this skill when the task is specifically about persistence design or implementation in a Spring Boot codebase. This skill adds value through aggregate-root guidance, query-pattern selection, CQRS read-model decisions, and the bundled repository and relationship templates. ## Critical rules - Never create repositories for every entity. Create repositories only for aggregate roots. - Never rely on long derived query method names when the query has become non-trivial. - Never use `save()` blindly when entity state transitions matter; understand persist versus merge behavior. - Prefer projections or dedicated query services for read-heavy paths. - Keep transaction boundaries in the service layer unless the existing architecture intentionally does otherwise. ## Workflow ### Step 1: Identify the persistence problem Collect the minimum context first: 1. Is the type an aggregate root or an internal entity? 2. Is the task primarily read-side, write-side, or both? 3. Is the query simple lookup, filtered search, aggregation, projection, or dynamic criteria? 4. Is the path performance-sensitive? 5. Are there module-boundary or loose-coupling constraints that affect relationship modeling? ### Step 2: Choose the implementation pattern Use this table to decide what to load next. | Pattern | Use when | Read | |---------|----------|------| | Simple repository | Basic CRUD and 1-2 simple lookups | Existing code or none | | `@Query` rep