spring-jpa

Implement JPA/Hibernate patterns for Spring Boot entity design and data access.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/dprice-dev/claude-java-skills --skill spring-jpa-dprice-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-jpa
Source: https://github.com/dprice-dev/claude-java-skills/tree/main/.claude/skills/spring-jpa
Command: npx skills add https://github.com/dprice-dev/claude-java-skills --skill spring-jpa-dprice-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It eliminates fragile and inefficient persistence code by providing production-grade patterns for entity modeling, repository design, query optimization, transaction boundaries, auditing, and Flyway-aligned database changes.

Core Features & Use Cases

  • Entity design & safety rules: Consistent JPA mappings, lifecycle listeners (auditing), optimistic locking, and domain-method state transitions to prevent illegal updates.
  • Performance-focused querying: N+1 detection guidance, JOIN FETCH / @EntityGraph patterns, pagination usage, and Hibernate batch fetch tuning.
  • Repository & transaction patterns: Specification-ready repositories, JPQL/Criteria-friendly query shapes, @Modifying with transactional updates, and readOnly transaction defaults.
  • Flyway migration alignment: Practical rules for when entity changes require migrations and how to apply zero-downtime column/index changes safely.
  • Connection pool tuning: HikariCP configuration defaults aimed at stable throughput and predictable latency.

Quick Start

Use spring-jpa when designing a new database entity and its repository methods, then ask it to propose the entity mapping, repository API, transactional boundaries, and the required Flyway migration steps.

Frequently Asked Questions about spring-jpa

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix N+1 queries in Spring Boot JPA repositories?

Fix N+1 queries in Spring Boot JPA by applying JOIN FETCH clauses, configuring @EntityGraph annotations, and tuning Hibernate batch fetch sizes to optimize lazy-loaded collections and prevent redundant database round-trips.

What is the best way to design Spring Boot JPA entity mappings and repositories?

Design Spring Boot JPA entities and repositories by structuring correct @Entity mappings with lifecycle listeners for auditing, applying optimistic locking, and creating Specification-ready repositories with readOnly transaction defaults for safe data access.

When do Spring Boot JPA entity changes require Flyway database migrations?

Spring Boot JPA entity changes require Flyway database migrations whenever structural schema modifications occur, applying zero-downtime column and index changes safely to align database state with updated Hibernate mappings.

How do I manage transaction boundaries and readOnly defaults in Spring Boot JPA?

Manage transaction boundaries in Spring Boot JPA by applying readOnly transaction defaults to query methods, using @Modifying with explicit transactional updates, and ensuring safe transaction demarcation across repository operations.

How do I configure HikariCP connection pool sizing for Spring Boot JPA?

Configure HikariCP connection pool sizing for Spring Boot JPA by applying stable throughput configuration defaults, ensuring predictable latency, and tuning connection allocation parameters to handle concurrent database access efficiently.