What problem does it solve?
Prevents common JPA/Hibernate pitfalls that lead to poor performance and data inconsistencies by prescribing entity design, relationship handling, query optimization, transaction practices, and pooling recommendations.
Core Features & Use Cases
- Entity design & auditing: guidance on lean entities, indexes, enum mapping, and enabling JPA auditing for created/updated timestamps.
- Relationships & N+1 prevention: strategies for lazy loading, join fetches, and DTO projections to avoid N+1 queries.
- Repository patterns & pagination: examples for custom JPQL queries, pageable results, and cursor-style pagination for large datasets.
- Transactions, pooling & migrations: best practices for @Transactional boundaries, HikariCP tuning, Flyway/Liquibase migration guidance, and testing with Testcontainers.
- Use Case: Optimize a Spring Boot service that exposes paginated Market listings with related positions to remove N+1 queries, add proper indexes, and tune connection pooling for throughput.
Quick Start
Use the jpa-patterns skill to review entity mappings, detect N+1 issues, and recommend indexing, pagination, and HikariCP settings for a Spring Boot project.