skills/spring-boot/spring-boot-data-access/SKILL.md
Optimize JPA, Hibernate, and database interactions in Spring Boot. Use when implementing JPA entities, repositories, or database access in Spring Boot.
npx skillsauth add hoangnguyen0403/agent-skills-standard spring-boot-data-accessInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
@Transactional(readOnly = true) on Services to optimize DB resources.Java Records for Read-Only query results. Avoid fetching full @Entity objects when not necessary.Pageable and Slice (or Page) to prevent loading massive datasets.JpaRepository and Query methods. Use @Query with JPQL for complex logic. Use Flyway or Liquibase for migrations; never use ddl-auto=create in production.See implementation examples for repository projections, EntityGraph, and transactional patterns.
N+1 selects using JOIN FETCH (JPQL) or @EntityGraph.spring.jpa.open-in-view=false in application.yaml.@Modifying with @Query for updates/deletes to bypass EntityManager overhead.HikariCP with explicit maximum-pool-size. Tune Hikari pool-size based on expected concurrent queries.JOIN FETCH or @EntityGraph instead of lazy-loading in loops.@Data (Lombok) on Entities as it breaks Proxy and hashCode/equals performance.@Transactional on public Repository methods if Service already transactional.testing
Infer the requesting operator's technical fluency from message content (never ask directly) and adapt register — business, hybrid, or technical — across SDLC workflow output. Use when starting sdlc, brainstorm-feature, plan-feature, verify-work, publish-notes, or session-report, or whenever a request's phrasing signals a non-technical or cross-stack operator.
documentation
Define transaction boundaries, locking, and consistency guarantees for multi-step writes. Use when designing atomic operations, retries, idempotency, or concurrent write behavior.
development
Design relational or document schemas from access patterns, cardinality, and lifecycle. Use when modeling entities, choosing embed vs normalize, or shaping schema boundaries before implementation.
data-ai
Diagnose database latency with explain plans, index ownership, and query-shape review. Use when a query is slow, an index is missing, or scans and N+1 patterns appear.