jpa-patterns

Design and optimize JPA/Hibernate entity models and repositories for Spring Boot applications.

24|5|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/Luohaothu/everything-codex --skill jpa-patterns-luohaothu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jpa-patterns
Source: https://github.com/Luohaothu/everything-codex/tree/main/docs/zh-CN/skills/jpa-patterns
Command: npx skills add https://github.com/Luohaothu/everything-codex --skill jpa-patterns-luohaothu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing efficient, maintainable JPA/Hibernate patterns in Spring Boot apps to avoid common pitfalls like N+1 queries, inconsistent auditing, and brittle mappings.

Core Features & Use Cases

  • Entity design best practices (primary keys, indexes, auditing fields)
  • Relationship mapping and fetch strategies to prevent N+1
  • Repository patterns and query optimization (projections, pagination)
  • Transaction management and auditing integration
  • Indexing, performance tuning, and connection pool considerations
  • Reusable patterns across typical data-access scenarios (multi-tenant, auditing, soft delete)

Quick Start

Review the example entity patterns and apply them to your Spring Boot project to improve data modeling and performance.

Frequently Asked Questions about jpa-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix N+1 query problems in Spring Boot JPA applications?

Fix N+1 query problems in Spring Boot JPA by applying proper relationship mapping and fetch strategies. This Skill provides design patterns to optimize entity associations and repository queries, preventing inefficient data access loops.

What is the best way to implement auditing in a Spring Boot Hibernate entity?

Implement auditing in a Spring Boot Hibernate entity by integrating consistent auditing fields and transaction management. This Skill offers reusable patterns for robust domain modeling to ensure reliable tracking across typical data-access scenarios.

How do I optimize JPA pagination and projections for large result sets?

Optimize JPA pagination and projections by applying repository patterns and query performance tuning techniques. This Skill addresses indexing strategies and connection pool configuration to efficiently handle large data sets in Spring Boot.

Does this JPA design pattern support multi-tenant and soft delete architectures?

Yes, this JPA design pattern supports multi-tenant and soft delete architectures. It provides reusable data-access patterns specifically designed to handle these complex domain scenarios robustly within Spring Boot applications.

When should I use specific indexing strategies in Hibernate entity design?

Apply specific indexing strategies in Hibernate entity design during query performance tuning to prevent bottlenecks. This Skill guides indexing and connection pool configuration to optimize typical data-access layers in Spring Boot apps.