jpa-patterns

Installation
Summary

JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, and performance tuning in Spring Boot.

  • Covers entity mapping with auditing, soft deletes, indexing, and enumerated types; includes transaction management with read-only optimization and propagation strategies
  • Provides N+1 prevention techniques using lazy loading, JOIN FETCH queries, and DTO projections for lightweight reads
  • Demonstrates pagination with Pageable, custom repository methods, and cursor-based patterns for large datasets
  • Includes HikariCP connection pooling configuration, second-level caching guidance, and batch write optimization
  • Emphasizes testing with @DataJpaTest and Testcontainers, SQL debugging via Hibernate logging, and production-safe migrations with Flyway or Liquibase
SKILL.md

JPA/Hibernate Patterns

Use for data modeling, repositories, and performance tuning in Spring Boot.

When to Activate

  • Designing JPA entities and table mappings
  • Defining relationships (@OneToMany, @ManyToOne, @ManyToMany)
  • Optimizing queries (N+1 prevention, fetch strategies, projections)
  • Configuring transactions, auditing, or soft deletes
  • Setting up pagination, sorting, or custom repository methods
  • Tuning connection pooling (HikariCP) or second-level caching

Entity Design

@Entity
@Table(name = "markets", indexes = {
  @Index(name = "idx_markets_slug", columnList = "slug", unique = true)
Related skills
Installs
4.0K
GitHub Stars
179.7K
First Seen
Jan 30, 2026