What problem does it solve? Building persistence layers with JPA and Hibernate often leads to N+1 query problems, LazyInitializationException errors, and poorly tuned connection pools that degrade production performance. This Skill provides concrete patterns for entity design, query optimization, transaction management, and caching so you can build efficient data access layers without trial and error. ## Core Features & Use Cases - Entity Design: Map relationships (1:1, 1:N, N:M), inheritance strategies, auditing with @CreatedDate/@LastModifiedDate, and bidirectional association helpers. - Query Optimization: Prevent N+1 queries using JOIN FETCH, EntityGraph, @BatchSize, and DTO projections, with a decision table for choosing the right strategy. - Transactions & Caching: Configure @Transactional propagation and isolation, optimistic locking with @Version, and first/second-level caches with Redis integration. - Use Case: When a Spring Boot endpoint triggers hundreds of SQL statements per request, apply the JOIN FETCH and batch fetching patterns here to reduce it to a single optimized query. ## Quick Start Ask the assistant to review your JPA entities and repositories for N+1 query problems and recommend the appropriate fetch strategy.