jpa-persistence
Implements the persistence layer of a use case (UC-XXX) with Spring Data JPA and Hibernate: @Entity classes mapped onto the Flyway schema (ddl-auto=validate, never create or update), Spring Data JpaRepository interfaces, derived and @Query queries, interface and record projections, attribute converters, fetch joins and entity graphs against N+1 selects, and @Version optimistic locking. Detects a flat single-module or a hexagonal multi-module backend; in the hexagonal case it writes the persistence adapter and the outbound port it implements. No Lombok. Use when the user asks to "write the JPA entities", "create the repository for UC-001", "implement the persistence layer", "map the table to an entity", "fix the N+1 query", or mentions Spring Data JPA, Hibernate, @Entity, JpaRepository, or a persistence adapter. Normally run by /use-case-implement as the Persistence layer; it can also be run directly.
Pinned to revision dbb4e27b6d25, so it is the text this page describes rather than whatever the author pushed since.
Files
- skills/jpa-persistence/SKILL.md
- skills/jpa-persistence/references/layer.md
- skills/jpa-persistence/references/markers.md
Every link opens the file at its source, pinned to the revision this page describes.