This covers the JPA/Hibernate fundamentals you actually need for Spring Boot apps. It handles entity design patterns with proper indexing, relationship mapping that avoids N+1 queries, and repository patterns with DTO projections for performance. The transaction guidance is solid, especially the readOnly optimization tips. What I like most is the practical focus on connection pooling configuration and the emphasis on using Testcontainers for realistic data access testing. It's heavy on code examples and light on theory, which is exactly what you want when you're debugging why your queries are slow or setting up auditing.

skills.sh installs
5.8K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill jpa-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

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)
})
@EntityListeners(AuditingEntityListener.class)
public class MarketEntity {
  @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  @Column(nullable = false, length = 200)
  private String name;

  @Column(nullable = false, unique = true, length = 120)
  private String slug;

  @Enumerated(EnumType.STRING)
  private MarketStatus status = MarketStatus.ACTIVE;

  @CreatedDate private Instant createdAt;
  @LastModifiedDate private Instant updatedAt;
}

Enable auditing:

@Configuration
@EnableJpaAuditing
class JpaConfig {}

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Category
Java & JVM

More from affaan-m/everything-claude-code

All 256

Recommended

More Java & JVM
1affaan-m avatarspringboot-verificationaffaan-m/everything-claude-codespringboot verification5.4Kskills.sh installs
2affaan-m avatarquarkus-verificationaffaan-m/everything-claude-codequarkus verification1.6Kskills.sh installs
3mindrally avatarquarkusmindrally/skillsExpert guidance for Quarkus framework development with Jakarta EE, MicroProfile, GraalVM native builds, and reactive programming patterns1.1Kskills.sh installs
4alinaqi avatarandroid-javaalinaqi/claude-bootstrapandroid java583skills.sh installs
5sickn33 avatarjava-prosickn33/antigravity-awesome-skillsjava pro405skills.sh installs
6auth0 avatarauth0-java-mvc-commonauth0/agent-skillsUse when adding Auth0 login, logout, or callback handling to a Java Servlet web application. Integrates com.auth0:mvc-auth-commons for server-side Java apps — u388skills.sh installs