SKILL

jpa-patterns

JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot. Use when designing JPA entities or relationships, or when a Hibernate query, transaction, or N+1 problem needs fixing.

Target: Design & content creation. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • JPA/Hibernate Patterns
  • When to Activate
  • Entity Design
  • Relationships and N+1 Prevention
  • Repository Patterns
  • Transactions
  • Pagination
  • Indexing and Performance

Use for data modeling, repositories, and performance tuning in Spring Boot. 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 Enable auditing: Default to lazy loading; use JOIN FETCH in queries when needed Avoid EAGER on collections; use DTO projections for read paths Use projections for lightweight queries: Annotate service methods with @Transactional Use @Transactional(readOnly = true) for read paths to optimize Choose propagation carefully; avoid long-running transactions For cursor-like pagination, include id > :lastId in JPQL with ordering. Add indexes for common filters (status, slug, foreign keys) Use composite indexes matching query patterns (status, createdat) Avoid select ; project only needed columns Batch writes with saveAll and hibernate.jdbc.batchsize Recommended properties: For PostgreSQL LOB handling, add: 1st-level cache is per EntityManager; avoid keeping entities across tran

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
affaan-m/ECC
Source file
pi/core/skills/jpa-patterns/SKILL.md
Fixed revision
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Read the complete original documentation ↗

Requirements

  • Only the author’s Skill metadata is included. Read the full instructions to check dependencies, licensing and conditions of use.

A small first task

先阅读原作者说明,再决定是否在自己的 AI 工具中使用。

Instructions for your AI tool

Author documentation is not live verification by this site. Without evidence, we do not mark a resource as compatible, safe or free.

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:43.055Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.