Jpa Patterns
JPA and Hibernate patterns for entities, N+1 fixes, transactions, pagination, and HikariCP tuning in Spring Boot.
- CCM score
- 71 of 100
- skills.sh installs
- 13K
- GitHub stars
- 312.6K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers entity mapping, relationships, repository queries, transactions, auditing, pagination, indexing, connection pooling, and migrations
- Includes Java examples for
@Entitymapping,JOIN FETCHqueries, DTO projections, and@Transactionalservice methods - Enforces lazy loading over
EAGERcollections, plus Flyway or Liquibase migrations instead of Hibernate auto DDL in production - Designed for Spring Boot services that query relational databases through JPA and need N+1 or pooling fixes
Install
$ npx -y skills add affaan-m/ecc --skill jpa-patterns -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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 {}
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Java & JVM, Databases
- First seen
- Jul 14, 2026
Questions
What does the jpa-patterns skill help with in Spring Boot?
The jpa-patterns skill covers JPA and Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and connection pooling in Spring Boot. It is meant for data modeling, repositories, and performance tuning. It applies when designing JPA entities or fixing a Hibernate query, transaction, or N+1 problem.
How do I install the jpa-patterns skill?
Run npx -y skills add affaan-m/ecc --skill jpa-patterns -y in your project to install it. Once installed, the agent can apply JPA and Hibernate guidance to your Spring Boot code. The skill comes from the affaan-m/ecc repository on GitHub.
Where does jpa-patterns rank among Java and JVM skills?
The jpa-patterns skill sits in the Java and JVM category and ranks in the top 10 on that category page. Other skills in the category include java-springboot, springboot-patterns, java-coding-standards, kotlin-patterns, and springboot-verification. Its focus on JPA entities, queries, and transactions sets it apart from these broader Spring and Java guides.
Does jpa-patterns help with N+1 query problems in Hibernate?
Yes, the skill covers N+1 prevention through lazy loading, JOIN FETCH in queries, and DTO projections for read paths. It also advises against EAGER fetching on collections. These patterns help when a Hibernate query triggers many extra SQL statements.
What does jpa-patterns say about database migrations and testing?
The skill advises using Flyway or Liquibase for migrations and never relying on Hibernate auto DDL in production. For testing, it recommends @DataJpaTest with Testcontainers and logging Hibernate SQL to check query efficiency.
More from affaan-m/ecc
All 257- Rust Patterns12.9K
- Kotlin Coroutines Flows12.9K
- Configure Ecc12.9K
- Laravel Tdd12.8K
- Agentic Engineering12.8K
- Clickhouse Io12.7K
- Cost Aware Llm Pipeline12.7K
- Kotlin Patterns12.7K
- Iterative Retrieval12.6K
- Django Verification12.6K
- Nextjs Turbopack12.6K
- Content Engine12.5K
- Springboot Verification12.5K
- Context Budget12.5K
- Nutrient Document Processing12.5K
- Autonomous Loops12.4K
- Architecture Decision Records12.4K
- Investor Materials12.4K
- Swiftui Patterns12.4K
- Pytorch Patterns12.3K
- Bun Runtime12.3K
- Ai First Engineering12.3K
- Flutter Dart Code Review12.2K
- Perl Security12.2K
Similar to Jpa Patterns
More Java & JVMjava-jpa-hibernateSkillpluginagentmarketplace/custom-plugin-java627 installsProduction-ready JPA and Hibernate guidance covering entity design, N+1 prevention, transactions, and caching.
spring-data-jpaSkillgiuseppe-trisciuoglio/developer-kit4.4K installsSpring Data JPA repository, entity, query, and transaction patterns with guardrails against N+1 queries and EAGER fetching.
springboot-patternsSkillaffaan-m/ecc15.5K installsSpring Boot backend patterns covering REST layers, JPA repositories, caching, async work, and logging.
kotlin-exposed-patternsSkillaffaan-m/ecc11.6K installsReference patterns for the JetBrains Exposed ORM covering DSL and DAO queries, transactions, and production setup.
412-frameworks-quarkus-panachePluginjabrena/plinth467 starsUse when you need data access with Quarkus Hibernate ORM Panache — including PanacheEntity / PanacheEntityBase, PanacheRepository, named queries, JPQL, native S
kotlin-backend-jpa-entity-mappingSkillkotlin/kotlin-agent-skills1.9K installsKotlin JPA entity guidance that replaces data classes with identity-safe classes, uniqueness constraints, and fetch plans.